700
|
Is it possible to display the header using multiple lines(sample 1)

PROCEDURE OnAddColumn(oTree, Column)
/*Column.Def(52) = 4*/
/*Column.Def(53) = 4*/
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumns
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:AddColumn := {|Column| OnAddColumn(oTree, Column)} /*Fired after a new column has been added.*/
oTree:BeginUpdate()
oTree:HeaderHeight := 36
oTree:HeaderAppearance := 1/*Flat*/
oTree:HeaderSingleLine := .F.
oColumns := oTree:Columns()
oColumns:Add("Column")
oColumns:Add("This is a bit of text that should break the header"):Width := 128
oColumns:Add("This is a bit of text that should break the header"):Width := 96
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
699
|
Is it possible to display the header using multiple lines(sample 2)

PROCEDURE OnAddColumn(oTree, Column)
/*Column.Def(52) = 4*/
/*Column.Def(53) = 4*/
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumns
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:AddColumn := {|Column| OnAddColumn(oTree, Column)} /*Fired after a new column has been added.*/
oTree:BeginUpdate()
oTree:HeaderHeight := 36
oTree:HeaderAppearance := 1/*Flat*/
oColumns := oTree:Columns()
oColumns:Add("Column")
oColumns:Add("C1"):HTMLCaption := "<b>C<off 4>1</b><br>left"
oColumns:Add("C2"):HTMLCaption := "<c><b>C<off 4>2</b><br><c>center"
oColumns:Add("C3"):HTMLCaption := "<r><b>C<off 4>3</b><br><r>right"
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
698
|
Is it possible to exclude the parent/child items when do the filtering, so to include only items that match the filter without any indentation

PROCEDURE OnFilterChange(oTree)
oTree:Indent := oTree:FormatABC("value > 0 ? 18 : 0",:Items:MatchItemCount())
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1
LOCAL oColumns
LOCAL oItems
LOCAL oTree
LOCAL h,h2
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:FilterChange := {|| OnFilterChange(oTree)} /*Notifies your application that the filter is changed.*/
oTree:BeginUpdate()
oTree:LinesAtRoot := -1/*exLinesAtRoot*/
oTree:Indent := 18
oTree:FilterInclude := 4/*exMatchingItemsOnly*/
oTree:DrawGridLines := 2/*exVLines*/
oTree:HeaderAppearance := 1/*Flat*/
oColumns := oTree:Columns()
oColumn := oColumns:Add("Column")
oColumn:DisplayFilterButton := .T.
oColumn:FilterType := 240/*exFilter*/
oColumn:FilterList := 256/*exShowCheckBox*/
oColumn:Filter := "C1"
oColumn1 := oColumns:Add("Pos")
oColumn1:FormatColumn := "1 rindex ``"
oColumn1:Position := 0
oColumn1:AllowSizing := .F.
oColumn1:AllowDragging := .F.
oItems := oTree:Items()
h := oItems:AddItem("R1")
h2 := oItems:InsertItem(h,,"S")
oItems:InsertItem(h2,,"C1")
oItems:InsertItem(h2,,"C2")
oItems:InsertItem(h,,"C1")
oItems:InsertItem(h,,"C2")
oItems:SetProperty("ExpandItem",h,.T.)
h := oItems:AddItem("R2")
oItems:InsertItem(h,,"C1")
oItems:InsertItem(h,,"C2")
oTree:ApplyFilter()
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
697
|
I would like to display a solid line between "root" items, and dotted lines (default) between child items. How can I do that

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1
LOCAL oConditionalFormat
LOCAL oItems
LOCAL oTree
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:LinesAtRoot := -1/*exLinesAtRoot*/
oTree:DrawGridLines := 1/*exHLines*/
oTree:GridLineStyle := 512/*exGridLinesGeometric*/
oTree:VisualAppearance():Add(1,"gBFLBCJwBAEHhEJAAEhABMsIQAAYAQGKIcBiAKBQAGaAoDgYN4MAANAwjJBMKgBBCLIxhEYobgmGIXRpFMbxAKQahLEiTIgGUYJHgmK4tQLHb7zGAABRDDSOIDnGQJXhaI4JQSMMQDGLAZxVFiPRhAWLpBh+PQATrOdLUfSjVwhBKAQEBA==")
oColumn := oTree:Columns():Add("Default")
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:PartialCheck := .T.
oColumn1 := oTree:Columns():Add("Position")
oColumn1:FormatColumn := "((1 rindex ``) contains `.`) = 0"
oColumn1:Visible := .F.
oConditionalFormat := oTree:ConditionalFormats():Add("%C1")
oConditionalFormat:SetProperty("BackColor",0x1e0e0e0)
oItems := oTree:Items()
h := oItems:AddItem("Root 1")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oItems:InsertItem(h,,"Child 3")
oItems:SetProperty("ExpandItem",h,.T.)
h := oItems:AddItem("Root 2")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
h := oItems:AddItem("Root 3")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
696
|
I can not center or align the cell's caption and icon, when it displays the hierarchy

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oItems
LOCAL oTree
LOCAL h,hChild
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
oColumn := oTree:Columns():Add("Tasks")
oColumn:SetProperty("Def",17/*exCellCaptionFormat*/,1)
oTree:HeaderVisible := .T.
oItems := oTree:Items()
h := oItems:AddItem("Project")
hChild := oItems:InsertItem(h,,"<img>1</img> Task (left)")
hChild := oItems:InsertItem(h,,"<c><img>2</img> Task (center)")
hChild := oItems:InsertItem(h,,"<r>Task (right) <img>3</img>")
oItems:SetProperty("ExpandItem",h,.T.)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
695
|
How do I set an extra data for each item
PROCEDURE OnMouseMove(oTree, Button, Shift, X, Y)
LOCAL i
i := oTree:ItemFromPoint(-1,-1,c,hit)
DevOut( Transform(i,"") )
DevOut( Transform(oTree:Items:ItemData(i),"") )
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oItems,oItems1
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:MouseMove := {|Button, Shift, X, Y| OnMouseMove(oTree, Button, Shift, X, Y)} /*Occurs when the user moves the mouse.*/
oTree:BeginUpdate()
oTree:ColumnAutoResize := .T.
oTree:Columns():Add("Default")
oItems := oTree:Items()
oItems:SetProperty("ItemData",oItems:AddItem("method 1"),"your extra data of method 1")
oItems:InsertItem(0,"your extra data of method 2","method 2")
oItems1 := oTree:Items()
oItems1:DefaultItem := oItems1:AddItem("method 3")
oItems1:SetProperty("ItemData",0,"your extra data of method 3")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
694
|
I do not like to specify the item padding for every column I add. The question is how can I do it automatically

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oColumns
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:AttachTemplate("handle AddColumn(Column){Column{Def(48)=8;Def(49)=8;AllowDragging=False;AllowSizing = True}}")
oTree:HeaderAppearance := 4/*Etched*/
oTree:DrawGridLines := -1/*exAllLines*/
oTree:GridLineStyle := 32/*exGridLinesVSolid*/
oColumns := oTree:Columns()
oColumns:Add("Item")
oColumn := oColumns:Add("Pos")
oColumn:Position := 0
oColumn:Width := 32
oColumn:AllowSizing := .F.
oColumn:FormatColumn := "1 index ``"
oItems := oTree:Items()
oItems:AddItem("Item A")
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
693
|
Can I sort the column by check-state

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oColumn := oTree:Columns():Add("Check")
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:SortType := 32/*exSortByState*/
oItems := oTree:Items()
oItems:AddItem()
oItems:SetProperty("CellState",oItems:AddItem(),0,1)
oItems:SetProperty("CellState",oItems:AddItem(),0,1)
oItems:AddItem()
oTree:Columns:Item(0):SortOrder := 1/*SortAscending*/
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
692
|
Can I sort the column by image

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
oColumn := oTree:Columns():Add("Image")
oColumn:SortType := 48/*exSortByImage*/
oItems := oTree:Items()
oItems:SetProperty("CellImage",oItems:AddItem(),0,3)
oItems:AddItem()
oItems:SetProperty("CellImage",oItems:AddItem(),0,1)
oItems:SetProperty("CellImage",oItems:AddItem(),0,2)
oTree:Columns:Item(0):SortOrder := 1/*SortAscending*/
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
691
|
How can I display UNICODE characters

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oItems
LOCAL oTree
LOCAL oStdFont
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oStdFont := oTree:Font()
oStdFont:Name := "Arial Unicode"
oStdFont:Size := 22
oTree:HeaderVisible := .F.
oTree:DefaultItemHeight := 48
oTree:Columns():Add(""):SetProperty("Def",17/*exCellCaptionFormat*/,1)
oItems := oTree:Items()
oItems:AddItem("Ӓӓ")
oItems:AddItem("ᦜᦝ;ᦞ")
oItems:AddItem("ɮɭ;ɯ")
oItems:AddItem("勳勴勵勶")
oItems:SetProperty("FormatCell",oItems:AddItem(oTree:Version()),0,"(value lfind `UNICODE`) < 0 ? `<fgcolor=FF0000><b>!UNICODE!</b> version</fgcolor> required: ` + value : `` ")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
690
|
How do I display the position of the item with 0-padding
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:Columns():Add("Items"):FormatColumn := "((1 apos ``) lpad `00`) + `. ` + value"
oItems := oTree:Items()
oItems:AddItem("Item A")
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oItems:AddItem("Item D")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
689
|
Can't get the +/- to be displayed on a divider item. What else can I do

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumns
LOCAL oItems
LOCAL oTree
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:LinesAtRoot := -1/*exLinesAtRoot*/
oTree:DrawGridLines := -1/*exAllLines*/
oTree:TreeColumnIndex := 0
oTree:MarkSearchColumn := .F.
oTree:FullRowSelect := .F.
oTree:HeaderAppearance := -1/*0xfffffff8+Bump+Sunken*/
oColumns := oTree:Columns()
oColumns:Add("C1"):Width := 32
oColumns:Add("C2"):FormatColumn := "1 index ``"
oItems := oTree:Items()
h := oItems:AddItem("Cell 1")
oItems:SetProperty("CellSingleLine",h,1,0/*exCaptionWordWrap*/)
h := oItems:AddItem("This is bit of text merges all cells in the item (divider shows no +/-)")
oItems:SetProperty("ItemDivider",h,0)
oItems:SetProperty("ItemBackColor",h,AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. ))
oItems:SetProperty("ItemDividerLine",h,0/*EmptyLine*/)
oItems:SetProperty("CellHAlignment",h,0,1/*CenterAlignment*/)
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oItems:SetProperty("ExpandItem",h,.T.)
h := oItems:AddItem("Cell 3")
h := oItems:AddItem("This is bit of text merges all cells in the item (merge shows +/-)")
oItems:SetProperty("ItemBackColor",h,AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. ))
oItems:SetProperty("CellMerge",h,0,1)
oItems:InsertItem(h,,"Child 3")
oItems:InsertItem(h,,"Child 4")
oItems:SetProperty("ExpandItem",h,.T.)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
688
|
ADODB Requery sample

PROCEDURE OnCellButtonClick(oTree, Item, ColIndex)
LOCAL cmd
cmd := CreateObject("ADODB.Command")
cmd:ActiveConnection := oTree:DataSource():ActiveConnection()
cmd:CommandText := "INSERT INTO Orders (EmployeeID) VALUES(12345)"
cmd:CommandType := 1/*adCmdText*/
cmd:Execute()
oTree:DataSource():Requery()
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oItems
LOCAL oTree
LOCAL h
LOCAL rs
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:CellButtonClick := {|Item, ColIndex| OnCellButtonClick(oTree, Item, ColIndex)} /*Fired after the user clicks on the cell of button type. */
oTree:BeginUpdate()
oTree:HeaderAppearance := 4/*Etched*/
oTree:ColumnAutoResize := .F.
rs := CreateObject("ADODB.Recordset")
rs:Open("Select * From Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExTree\Sample\Access\sample.accdb",1/*adOpenKeyset*/,3/*adLockOptimistic*/)
oTree:DataSource := rs
oTree:ConditionalFormats():Add("%1=12345"):SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. ))
oItems := oTree:Items()
oItems:SetProperty("LockedItemCount",0/*TopAlignment*/,1)
h := oItems:LockedItem(0/*TopAlignment*/,0)
oItems:SetProperty("ItemDivider",h,0)
oItems:SetProperty("CellHasButton",h,0,.T.)
oItems:SetProperty("CellCaption",h,0,"Requery (add a new record, using ADODB.Command)")
oItems:SetProperty("CellHAlignment",h,0,1/*CenterAlignment*/)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
687
|
How do I use the ColumnsFloatBarVisible on exColumnsFloatBarVisibleIncludeCheckColumns

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumns
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:ColumnAutoResize := .F.
oTree:HeaderAppearance := 4/*Etched*/
oColumns := oTree:Columns()
oColumns:Add("City")
oColumns:Add("Start"):Visible := .F.
oColumns:Add("End"):Visible := .F.
oTree:SetProperty("Description",26/*exColumnsFloatBar*/,"Show/Hide")
oTree:ColumnsFloatBarSortOrder := 1/*SortAscending*/
oTree:ColumnsFloatBarVisible := 2/*exColumnsFloatBarVisibleIncludeCheckColumns*/
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
686
|
How do I use the ColumnsFloatBarVisible on exColumnsFloatBarVisibleIncludeHiddenColumn

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumns
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:ColumnAutoResize := .F.
oTree:HeaderAppearance := 4/*Etched*/
oColumns := oTree:Columns()
oColumns:Add("City")
oColumns:Add("Start"):Visible := .F.
oColumns:Add("End"):Visible := .F.
oTree:SetProperty("Description",26/*exColumnsFloatBar*/,"Show")
oTree:ColumnsFloatBarVisible := -1/*exColumnsFloatBarVisibleIncludeHiddenColumns*/
oTree:ColumnsFloatBarSortOrder := 1/*SortAscending*/
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
685
|
Type of wraps the cell's caption support (Sample 2)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1,oColumn2
LOCAL oColumns
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:HeaderSingleLine := .F.
oTree:HeaderHeight := 36
oTree:DrawGridLines := -2/*exRowLines*/
oTree:ColumnAutoResize := .F.
oTree:ScrollBySingleLine := .T.
oColumns := oTree:Columns()
oColumn := oColumns:Add("Single-Line (exCaptionSingleLine)")
oColumn:Width := 96
oColumn:SetProperty("Def",17/*exCellCaptionFormat*/,1)
oColumn:SetProperty("Def",16/*exCellSingleLine*/,-1)
oColumn1 := oColumns:Add("Word-Wrap (exCaptionWordWrap)")
oColumn1:Width := 96
oColumn1:SetProperty("Def",17/*exCellCaptionFormat*/,1)
oColumn1:SetProperty("Def",16/*exCellSingleLine*/,0)
oColumn1:FormatColumn := "%0"
oColumn2 := oColumns:Add("Break-Wrap (exCaptionBreakWrap)")
oColumn2:Width := 96
oColumn2:SetProperty("Def",17/*exCellCaptionFormat*/,1)
oColumn2:SetProperty("Def",16/*exCellSingleLine*/,1)
oColumn2:FormatColumn := "%0"
oItems := oTree:Items()
oItems:AddItem("This is the <b>first</b> line.<br>This is the <b>second</b> line.<br>This is the <b>third</b> line.")
oItems:AddItem("This is the <b>first</b> line.\r\nThis is the <b>second</b> line.\r\nThis is the <b>third</b> line.")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
684
|
Type of wraps the cell's caption support (Sample 1)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oItems
LOCAL oTree
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:HeaderSingleLine := .F.
oTree:HeaderHeight := 36
oTree:DrawGridLines := -2/*exRowLines*/
oTree:ColumnAutoResize := .F.
oTree:ScrollBySingleLine := .T.
oTree:Columns():Add("Default"):Width := 128
oItems := oTree:Items()
h := oItems:AddItem("This is the first line.\r\nThis is the second line.\r\nThis is the third line.")
h := oItems:AddItem("This is the <b>first</b> line.<br>This is the <b>second</b> line.<br>This is the <b>third</b> line.")
oItems:SetProperty("CellCaptionFormat",h,0,1/*exHTML*/)
h := oItems:AddItem("This is the first line.\r\nThis is the second line.\r\nThis is the third line.")
oItems:SetProperty("CellSingleLine",h,0,0/*exCaptionWordWrap*/)
h := oItems:AddItem("This is the <b>first</b> line.<br>This is the <b>second</b> line.<br>This is the <b>third</b> line.")
oItems:SetProperty("CellCaptionFormat",h,0,1/*exHTML*/)
oItems:SetProperty("CellSingleLine",h,0,0/*exCaptionWordWrap*/)
h := oItems:AddItem("This is the first line.\r\nThis is the second line.\r\nThis is the third line.")
oItems:SetProperty("CellSingleLine",h,0,1/*exCaptionBreakWrap*/)
h := oItems:AddItem("This is the <b>first</b> line.<br>This is the <b>second</b> line.<br>This is the <b>third</b> line.")
oItems:SetProperty("CellCaptionFormat",h,0,1/*exHTML*/)
oItems:SetProperty("CellSingleLine",h,0,1/*exCaptionBreakWrap*/)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
683
|
Can I break the cell's caption using the line break <br> or \r\n (Sample 2)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:DrawGridLines := -2/*exRowLines*/
oTree:ColumnAutoResize := .F.
oTree:ScrollBySingleLine := .T.
oTree:Columns():Add("Default"):Width := 128
oItems := oTree:Items()
oItems:SetProperty("CellSingleLine",oItems:AddItem("This is the first line.\r\nThis is the second line.\r\nThis is the third line."),0,1/*exCaptionBreakWrap*/)
oItems:AddItem("This is the first line.\r\nThis is the second line.\r\nThis is the third line.")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
682
|
Can I break the cell's caption using the line break <br> or \r\n (Sample 1)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:DrawGridLines := -2/*exRowLines*/
oTree:ColumnAutoResize := .F.
oTree:ScrollBySingleLine := .T.
oColumn := oTree:Columns():Add("Default")
oColumn:Width := 128
oColumn:SetProperty("Def",16/*exCellSingleLine*/,1)
oItems := oTree:Items()
oItems:AddItem("This is the first line.\r\nThis is the second line.\r\nThis is the third line.")
oItems:AddItem("This is the first line.\r\nThis is the second line.\r\nThis is the third line.")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
681
|
How can I change the visual appearance/color of the Filter For ... field

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oItems
LOCAL oTree
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:LinesAtRoot := -1/*exLinesAtRoot*/
oTree:SetProperty("BackColorHeader",AutomationTranslateColor( GraMakeRGBColor ( { 1,0,0 } ) , .F. ))
oTree:SetProperty("ForeColorHeader",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. ))
oTree:SetProperty("Background",26/*exBackColorFilter*/,oTree:BackColorHeader())
oTree:SetProperty("Background",27/*exForeColorFilter*/,oTree:ForeColorHeader())
oTree:SetProperty("Background",0/*exHeaderFilterBarButton*/,AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. ))
oTree:SetProperty("Background",32/*exCursorHoverColumn*/,-1)
oTree:HeaderAppearance := 5/*Bump*/
oColumn := oTree:Columns():Add("Items")
oColumn:FilterOnType := .T.
oColumn:DisplayFilterButton := .T.
oColumn:FilterList := 2/*exNoItems*/
oItems := oTree:Items()
h := oItems:AddItem("Root 1")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oItems:SetProperty("ExpandItem",h,.T.)
h := oItems:AddItem("Root 2")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
680
|
How can I display the cell's caption without spaces on both sides

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:ColumnAutoResize := .T.
oColumn := oTree:Columns():Add("Default")
oColumn:SetProperty("Def",17/*exCellCaptionFormat*/,1)
oColumn:FormatColumn := "((trim(value) replace ` ` with ` `) replace ` ` with ` `) replace ` ` with `<bgcolor=FF0000> </bgcolor>`"
oItems := oTree:Items()
oItems:AddItem("")
oItems:AddItem("Item A")
oItems:AddItem(" Item B")
oItems:AddItem(" Item C ")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
679
|
How can I highlight the spaces within the column (sample 2)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:ColumnAutoResize := .T.
oColumn := oTree:Columns():Add("Default")
oColumn:SetProperty("Def",17/*exCellCaptionFormat*/,1)
oColumn:FormatColumn := "`'` + ( value replace ` ` with `_` ) + `'`"
oItems := oTree:Items()
oItems:AddItem("")
oItems:AddItem("Item A")
oItems:AddItem(" Item B")
oItems:AddItem(" Item C ")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
678
|
How can I highlight the spaces within the column (sample 1)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:ColumnAutoResize := .T.
oColumn := oTree:Columns():Add("Default")
oColumn:SetProperty("Def",17/*exCellCaptionFormat*/,1)
oColumn:FormatColumn := "len(value) = 0 ? `<bgcolor=FF0000> </bgcolor>` : ( value replace ` ` with `<bgcolor=FF0000> </bgcolor>` )"
oItems := oTree:Items()
oItems:AddItem("")
oItems:AddItem("Item A")
oItems:AddItem(" Item B")
oItems:AddItem(" Item C ")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
677
|
How can I change the visual aspect of the drop down filter-calendar

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:SetProperty("Background",26/*exBackColorFilter*/,AutomationTranslateColor( GraMakeRGBColor ( { 0,0,1 } ) , .F. ))
oTree:SetProperty("Background",27/*exForeColorFilter*/,AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. ))
oTree:SetProperty("Background",12/*exDateScrollRange*/,AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. ))
oTree:SetProperty("Background",8/*exDateHeader*/,oTree:Background(26/*exBackColorFilter*/))
oTree:SetProperty("Background",11/*exDateScrollThumb*/,AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. ))
oColumn := oTree:Columns():Add("Date")
oColumn:FilterType := 4/*exDate*/
oColumn:DisplayFilterButton := .T.
oColumn:DisplayFilterDate := .T.
oColumn:DisplayFilterPattern := .F.
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
676
|
Export Data in HTML format

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1,oColumn2,oColumn3,oColumn4,oColumn5,oColumn6
LOCAL oColumns
LOCAL oConditionalFormat,oConditionalFormat1
LOCAL oConditionalFormats
LOCAL oItems
LOCAL oShellBrowserWindow
LOCAL oTree
LOCAL h,sFile
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:LinesAtRoot := -1/*exLinesAtRoot*/
oTree:SetProperty("BackColorAlternate",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. ))
oTree:DrawGridLines := -1/*exAllLines*/
oTree:HeaderAppearance := 4/*Etched*/
oTree:SetProperty("Description",11/*exFilterBarAnd*/,Transform(oTree:FormatABC("`<fgcolor=808080> ` + value + ` </fgcolor>`",oTree:Description(11/*exFilterBarAnd*/)),""))
oTree:FilterBarCaption := "(( ( value replace `[<b>` with `<bgcolor=000000><fgcolor=FFFFFF><b> ` replace `</b>]` with ` </b></bgcolor></fgcolor>` replace `[<s>` with `<bgcolor=C0C0C0><fgcolor=FFFFFF> ` replace `</s>]` with ` </fgcolor></bgcolor>` ) + `<r><fgcolor=808080>` + ( matchitemcount < 0 ? ( ( len(value) ? `` : `` ) + `<r>` + abs(matchitemcount + 1) + ` result(s)` ) : (`<r><fgcolor=808080>`+ itemcount + ` item(s)`) )))"
oTree:FilterBarPromptVisible := 2579/*exFilterBarCompact+exFilterBarShowCloseIfRequired+exFilterBarSingleLine+exFilterBarVisible+exFilterBarPromptVisible*/
oTree:FilterBarPromptType := 2/*exFilterPromptContainsAny*/
oConditionalFormats := oTree:ConditionalFormats()
oConditionalFormats:Add("%0 like `*parent*`","parent"):SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 192,192,192 } ) , .F. ))
oConditionalFormat := oConditionalFormats:Add("%0 like `*child*`","child")
oConditionalFormat:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,128,128 } ) , .F. ))
oConditionalFormat:ApplyTo := 0/*exFormatToColumns*/
oConditionalFormat1 := oConditionalFormats:Add("%0 like `*B*`","b")
oConditionalFormat1:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,255 } ) , .F. ))
oConditionalFormat1:Bold := .T.
oConditionalFormat1:Italic := .T.
oConditionalFormat1:ApplyTo := 0/*exFormatToColumns*/
oColumns := oTree:Columns()
oColumn := oColumns:Add("Value")
oColumn:Width := 128
oColumn:HTMLCaption := "<b>VA</b><r>sko"
oColumn1 := oColumns:Add("APos")
oColumn1:FormatColumn := "0 apos ``"
oColumn1:AllowSort := .F.
oColumn1:SetProperty("Def",4/*exCellBackColor*/,15790320)
oColumn1:SetProperty("Def",5/*exCellForeColor*/,8421504)
oColumn1:SetProperty("Def",8/*exHeaderForeColor*/,oColumn1:Def(5/*exCellForeColor*/))
oColumn1:Position := 0
oColumn2 := oColumns:Add("RPos")
oColumn2:FormatColumn := "0 rpos ``"
oColumn2:AllowSort := .F.
oColumn2:Position := 1
oColumn3 := oColumns:Add("Index")
oColumn3:FormatColumn := "0 index ``"
oColumn3:DisplayFilterButton := .T.
oColumn3:FilterList := 256/*exShowCheckBox*/
oColumn3:Position := 2
oColumn4 := oColumns:Add("Data 1")
oColumn4:FormatColumn := "0 index `A-Z`"
oColumn4:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn5 := oColumns:Add("Data 2")
oColumn5:FormatColumn := "0 index `AB` replace `A` with `<off -4>A</off>`"
oColumn5:SetProperty("Def",16/*exCellSingleLine*/,.F.)
oColumn5:SetProperty("Def",17/*exCellCaptionFormat*/,1)
oColumn5:SetProperty("Def",1/*exCellHasRadioButton*/,.T.)
oColumn6 := oColumns:Add("Data 3")
oColumn6:FormatColumn := "0 index `CDC` replace `D` with `<b>D</b>`"
oColumn6:SetProperty("Def",17/*exCellCaptionFormat*/,1)
oItems := oTree:Items()
h := oItems:AddItem("ParentA")
oItems:InsertItem(h,,"Child A")
oItems:InsertItem(h,,"Child B")
oItems:SetProperty("CellState",h,4,1)
oItems:SetProperty("CellBackColor",oItems:InsertItem(h,,"Child C"),5,AutomationTranslateColor( GraMakeRGBColor ( { 0,255,0 } ) , .F. ))
oItems:SetProperty("ExpandItem",h,.T.)
oItems:AddItem("Item A")
h := oItems:AddItem("ParentB")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oItems:SetProperty("CellBackColor",oItems:InsertItem(h,,"Child 3"),5,AutomationTranslateColor( GraMakeRGBColor ( { 0,255,0 } ) , .F. ))
oItems:SetProperty("CellState",h,5,1)
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oItems:AddItem("Item D")
oItems:SetProperty("ExpandItem",h,.T.)
oTree:EndUpdate()
sFile := "c:/temp/export.html"
oTree:Export(sFile,"vis")
oShellBrowserWindow := CreateObject("InternetExplorer.Application")
oShellBrowserWindow:Navigate2(sFile)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
675
|
Export Data in CSV format

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1,oColumn2,oColumn3,oColumn4,oColumn5,oColumn6
LOCAL oColumns
LOCAL oConditionalFormat,oConditionalFormat1
LOCAL oConditionalFormats
LOCAL oItems
LOCAL oTree
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:LinesAtRoot := -1/*exLinesAtRoot*/
oTree:SetProperty("BackColorAlternate",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. ))
oTree:DrawGridLines := -1/*exAllLines*/
oTree:HeaderAppearance := 4/*Etched*/
oTree:SetProperty("Description",11/*exFilterBarAnd*/,Transform(oTree:FormatABC("`<fgcolor=808080> ` + value + ` </fgcolor>`",oTree:Description(11/*exFilterBarAnd*/)),""))
oTree:FilterBarCaption := "(( ( value replace `[<b>` with `<bgcolor=000000><fgcolor=FFFFFF><b> ` replace `</b>]` with ` </b></bgcolor></fgcolor>` replace `[<s>` with `<bgcolor=C0C0C0><fgcolor=FFFFFF> ` replace `</s>]` with ` </fgcolor></bgcolor>` ) + `<r><fgcolor=808080>` + ( matchitemcount < 0 ? ( ( len(value) ? `` : `` ) + `<r>` + abs(matchitemcount + 1) + ` result(s)` ) : (`<r><fgcolor=808080>`+ itemcount + ` item(s)`) )))"
oTree:FilterBarPromptVisible := 2579/*exFilterBarCompact+exFilterBarShowCloseIfRequired+exFilterBarSingleLine+exFilterBarVisible+exFilterBarPromptVisible*/
oTree:FilterBarPromptType := 2/*exFilterPromptContainsAny*/
oConditionalFormats := oTree:ConditionalFormats()
oConditionalFormats:Add("%0 like `*parent*`","parent"):SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 192,192,192 } ) , .F. ))
oConditionalFormat := oConditionalFormats:Add("%0 like `*child*`","child")
oConditionalFormat:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,128,128 } ) , .F. ))
oConditionalFormat:ApplyTo := 0/*exFormatToColumns*/
oConditionalFormat1 := oConditionalFormats:Add("%0 like `*B*`","b")
oConditionalFormat1:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,255 } ) , .F. ))
oConditionalFormat1:Bold := .T.
oConditionalFormat1:Italic := .T.
oConditionalFormat1:ApplyTo := 0/*exFormatToColumns*/
oColumns := oTree:Columns()
oColumn := oColumns:Add("Value")
oColumn:Width := 128
oColumn:HTMLCaption := "<b>VA</b><r>sko"
oColumn1 := oColumns:Add("APos")
oColumn1:FormatColumn := "0 apos ``"
oColumn1:AllowSort := .F.
oColumn1:SetProperty("Def",4/*exCellBackColor*/,15790320)
oColumn1:SetProperty("Def",5/*exCellForeColor*/,8421504)
oColumn1:SetProperty("Def",8/*exHeaderForeColor*/,oColumn1:Def(5/*exCellForeColor*/))
oColumn1:Position := 0
oColumn2 := oColumns:Add("RPos")
oColumn2:FormatColumn := "0 rpos ``"
oColumn2:AllowSort := .F.
oColumn2:Position := 1
oColumn3 := oColumns:Add("Index")
oColumn3:FormatColumn := "0 index ``"
oColumn3:DisplayFilterButton := .T.
oColumn3:FilterList := 256/*exShowCheckBox*/
oColumn3:Position := 2
oColumn4 := oColumns:Add("Data 1")
oColumn4:FormatColumn := "0 index `A-Z`"
oColumn4:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn5 := oColumns:Add("Data 2")
oColumn5:FormatColumn := "0 index `AB` replace `A` with `<off -4>A</off>`"
oColumn5:SetProperty("Def",16/*exCellSingleLine*/,.F.)
oColumn5:SetProperty("Def",17/*exCellCaptionFormat*/,1)
oColumn5:SetProperty("Def",1/*exCellHasRadioButton*/,.T.)
oColumn6 := oColumns:Add("Data 3")
oColumn6:FormatColumn := "0 index `CDC` replace `D` with `<b>D</b>`"
oColumn6:SetProperty("Def",17/*exCellCaptionFormat*/,1)
oItems := oTree:Items()
h := oItems:AddItem("ParentA")
oItems:InsertItem(h,,"Child A")
oItems:InsertItem(h,,"Child B")
oItems:SetProperty("CellState",h,4,1)
oItems:SetProperty("CellBackColor",oItems:InsertItem(h,,"Child C"),5,AutomationTranslateColor( GraMakeRGBColor ( { 0,255,0 } ) , .F. ))
oItems:SetProperty("ExpandItem",h,.T.)
oItems:AddItem("Item A")
h := oItems:AddItem("ParentB")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oItems:SetProperty("CellBackColor",oItems:InsertItem(h,,"Child 3"),5,AutomationTranslateColor( GraMakeRGBColor ( { 0,255,0 } ) , .F. ))
oItems:SetProperty("CellState",h,5,1)
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oItems:AddItem("Item D")
oItems:SetProperty("ExpandItem",h,.T.)
oTree:EndUpdate()
DevOut( Transform(oTree:Export("","vis"),"") )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
674
|
Is it possible to check multiple-items at once

PROCEDURE OnAddItem(oTree, Item)
LOCAL oItems
LOCAL bHasParent
bHasParent := oTree:FormatABC("value != 0",oTree:Items:ItemParent(Item))
oItems := oTree:Items()
oItems:SetProperty("CellHasCheckBox",Item,0,.F.)
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oItems
LOCAL oTree
LOCAL h,hChild
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:AddItem := {|Item| OnAddItem(oTree, Item)} /*Occurs after a new Item has been inserted to Items collection.*/
oTree:BeginUpdate()
oTree:LinesAtRoot := -1/*exLinesAtRoot*/
oColumn := oTree:Columns():Add("Tasks")
oColumn:SetProperty("Def",17/*exCellCaptionFormat*/,1)
oColumn:FormatColumn := "value + (%CS0 = 1 ? `<r><fgcolor=808080>(checked)` : ``)"
oTree:HeaderVisible := .T.
oTree:SingleSel := .F.
oItems := oTree:Items()
h := oItems:AddItem("Project")
hChild := oItems:InsertItem(h,,"Task 1")
hChild := oItems:InsertItem(h,,"Task 2")
hChild := oItems:InsertItem(h,,"Task 3")
oItems:SetProperty("ExpandItem",h,.T.)
oItems:SetProperty("LockedItemCount",0/*TopAlignment*/,1)
oItems:SetProperty("CellCaption",oItems:LockedItem(0/*TopAlignment*/,0),0,"<c>Select multiple items and press the <b>SPACE</b> key")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
673
|
How can I get the icon from the cell when using the Items.CellImages property (icon index)

PROCEDURE OnMouseMove(oTree, Button, Shift, X, Y)
LOCAL i
i := oTree:ItemFromPoint(-1,-1,c,hit)
DevOut( Transform(oTree:FormatABC("( 0x44 = ( value bitand 0x44 ) ) ? ( ( (value bitand 0xFFFF0000) bitshift 16 ) array B split `,` ) : `no image`",hit,oTree:Items:CellImages(i,c)),"") )
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:MouseMove := {|Button, Shift, X, Y| OnMouseMove(oTree, Button, Shift, X, Y)} /*Occurs when the user moves the mouse.*/
oTree:BeginUpdate()
oTree:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
oTree:Columns():Add("Default")
oItems := oTree:Items()
oItems:SetProperty("CellImages",oItems:AddItem("Item 1"),0,"3,2,1")
oItems:SetProperty("CellImages",oItems:AddItem("Item 2"),0,"2,3")
oItems:SetProperty("CellImages",oItems:AddItem("Item 3"),0,"2,")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
672
|
How can I get the icon from the cell when using the Items.CellImages property (icon position within the cell)

PROCEDURE OnMouseMove(oTree, Button, Shift, X, Y)
LOCAL i
i := oTree:ItemFromPoint(-1,-1,c,hit)
DevOut( Transform(oTree:FormatABC("( 0x44 = ( value bitand 0x44 ) ) ? 1 + ( (value bitand 0xFFFF0000) bitshift 16 ) : `no image`",hit),"") )
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:MouseMove := {|Button, Shift, X, Y| OnMouseMove(oTree, Button, Shift, X, Y)} /*Occurs when the user moves the mouse.*/
oTree:BeginUpdate()
oTree:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
oTree:Columns():Add("Default")
oItems := oTree:Items()
oItems:SetProperty("CellImages",oItems:AddItem("Item 1"),0,"3,2,1")
oItems:SetProperty("CellImages",oItems:AddItem("Item 2"),0,"2,3")
oItems:SetProperty("CellImages",oItems:AddItem("Item 3"),0,"2")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
671
|
Is it possible to change the visual appearance of the position signs when user changes the column's position by drag and drop

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oAppearance
LOCAL oColumns
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:HeaderAppearance := 4/*Etched*/
oColumns := oTree:Columns()
oColumns:Add("Column 1")
oColumns:Add("Column 2")
oColumns:Add("Column 3")
oAppearance := oTree:VisualAppearance()
oAppearance:Add(1,"gBFLBCJwBAEHhEJAAEhABZEGACAADACAxRDgMQBQKAAzAJBIYhiG4cYCgMYxXDOCYXABCEYRXBIZQ7BKNIxjSJwFgmEgADKMA4SOKIZhrE4bBhGaQRUgyI43RhHUBzVIUcQvE6TZRHCQYHgkNIhDJIM7TPLkeSVJaTIRoKhJUogApQThTMgVRDEThkGoSa6soSoYTDBKybLrSLKagOT5YUDKUqSdKEZRpEq1YztWbaQoCUoqVRRVIWfbNd4JJa4aDhWpYdpeeY5R7bWLgBYVVABL7LLRsSxpHxPF6RXxaeI3GKsaS8G6ic6nPQMHj7I4NS5pUa6Rh2VYNSa8AAtETRYznOw4bTMXAjNIea5bAYIIR5HIoDzVbQcCQAHL9DBeEMIQEEISgGhMGZQmocgymoYRRCIEQ0G2HYBnEIBig4V4zCQGINnmagCECY43medZ6H2Pw/g+X5fnueh/h+R5+AKABfkMWgGgGYA4AICoCGCE5WA4CphACMgSD2IRIDI" +;
"BICmEd5YGCBpRjGBgegWIYIgWdgoGIRQsiKCZiAiJZ0gGQI4jUS4LECOAiBmDJflGfg2BSY4Al4OhGkOCJ2DgFJjGGfgqgiH5Ch4RhGkqOQmEOEpkFkHQYhJRYyESAokGKHhIhKIxJEmf4VGUeRGFmF5iBkchPhYJQ5GoYIZg6Ug6GoFYmkmNhuhulRGHKGoImefh0BUZ4JmYeoemeSZ2H6HQmgoBgXDqXwUAQgI=")
oAppearance:Add(2,"CP:1 0 -36 0 0")
oTree:SetProperty("Background",182/*exColumnsPositionSign*/,0x2000000)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
670
|
A black portion is shown while I am using the BackColorAlternate with EBN colors. What can I do

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1
LOCAL oConditionalFormat
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:ColumnAutoResize := .T.
oTree:DefaultItemHeight := 20
oTree:VisualAppearance():Add(1,"gBFLBCJwBAEHhEJAAEhIDhAxHAxg0HG0Mg4xGI3HMOig3GcJiYAf8jAEhhUnAAyhEqg8hk0oAsIjgAiAwmYxGA4mYzGwwkI0i0ooUnB0IBMIl1Dg8zmYyGolptPkI1mY1GAll9KoUslNIrVCqNQldShFUstXAVfrVcrlZtVhuFnsUHq1zoczoQGhFBkNpg6zbDykUkhsPHE2h85nc9n8xtVDtlex9Msd2p1YstVq9ux8HyMtzuFz1PsNTzQlv2hhWfkuqpeVuN0q+nvEooN5veSAGpkb/ACcZrvhU3w83nM/poxGuchGpoVBvWgg+8knA4WimnFxI45Er5XOlHMg/Q3XU33W4ew9Wyu11mchDagcO7zus8VDoNBBEIKBpMY6DqOQyokhA/IQIQmwMk4bIQFDcoO6LWgwhQkNcABwEyAB5GwWbet6cRQg3DENQ5D8QxADZvEkAB8nabsURGeBpFM3pwE2AEZRpDx/neZpOR3Dz9oO/r/wCMoZNTBQAQR" +;
"JSEwYg8HPGhEIoNCaEwq10gQ2WcRt7LcRxRFpuxUAEURQ3sczBEMgTTG8gN7HpOSEAEiQBAQZpmQ0DibPUFwbKcHwkhQoQtNQNzNEMbABOKDy/DMYQzHLeoPL0OTJSUd0pHcxTewk5zrIygIRPslz4lEngBKIAQivgASs/kLSBTlO00f8t0vGcgUbDlDRjXLCUNRERRvRgAHW2oAICA==")
oColumn := oTree:Columns():Add("Default")
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:PartialCheck := .T.
oColumn1 := oTree:Columns():Add("Position")
oColumn1:FormatColumn := "1 rindex ``"
oColumn1:Visible := .F.
oConditionalFormat := oTree:ConditionalFormats():Add("%C1 mod 2")
oConditionalFormat:SetProperty("BackColor",0x1000000)
oItems := oTree:Items()
oItems:AddItem("Item 1")
oItems:AddItem("Item 2")
oItems:AddItem("Item 3")
oItems:AddItem("Item 4")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
669
|
How can I specify alternate background colors for each root item, similar with BackColorAlternate

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1
LOCAL oConditionalFormat
LOCAL oItems
LOCAL oTree
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:LinesAtRoot := -1/*exLinesAtRoot*/
oColumn := oTree:Columns():Add("Default")
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:PartialCheck := .T.
oColumn1 := oTree:Columns():Add("Position")
oColumn1:FormatColumn := "( ( 1:=( ( 0:=(1 rpos '') ) lfind `.`) ) < 0 ? =:0 : (=:0 left =:1) )"
oColumn1:Visible := .F.
oConditionalFormat := oTree:ConditionalFormats():Add("%C1 mod 2")
oConditionalFormat:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. ))
oItems := oTree:Items()
h := oItems:AddItem("Root 1")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oItems:SetProperty("ExpandItem",h,.T.)
h := oItems:AddItem("Root 2")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
h := oItems:AddItem("Root 3")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
668
|
Is it possible to change the caption from a column without to remove the column and add it with the new caption
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:Columns():Add("ColumnName"):Caption := "NewName"
oTree:Columns():Add("ColumnName"):HTMLCaption := "<b>New</b>Name"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
667
|
FilterBarCaption ALL Keyword ( sample 2, result )

PROCEDURE OnAddItem(oTree, Item)
LOCAL i
i := oTree:FormatABC("value + 1",oTree:Items:ItemToIndex(Item))
oTree:Items():SetProperty("CellImage",Item,3,i)
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1,oColumn2,oColumn3,oColumn4,oColumn5
LOCAL oItems
LOCAL oTree
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:AddItem := {|Item| OnAddItem(oTree, Item)} /*Occurs after a new Item has been inserted to Items collection.*/
oTree:BeginUpdate()
oTree:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
oColumn := oTree:Columns():Add("Col-1")
oColumn:DisplayFilterButton := .T.
oColumn:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
oColumn1 := oTree:Columns():Add("Col-2")
oColumn1:DisplayFilterButton := .T.
oColumn1:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
oColumn2 := oTree:Columns():Add("Check")
oColumn2:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn2:DisplayFilterButton := .T.
oColumn2:DisplayFilterPattern := .F.
oColumn2:FilterType := 6/*exCheck*/
oColumn3 := oTree:Columns():Add("Image")
oColumn3:DisplayFilterButton := .T.
oColumn3:FilterType := 10/*exImage*/
oColumn3:FilterList := 9472/*exShowExclude+exShowFocusItem+exShowCheckBox*/
oColumn4 := oTree:Columns():Add("Pos")
oColumn4:AllowSizing := .F.
oColumn4:AllowSort := .F.
oColumn4:Width := 32
oColumn4:FormatColumn := "1 apos ``"
oColumn4:Position := 0
oItems := oTree:Items()
oItems:SetProperty("CellCaption",oItems:AddItem("Item A"),1,"Sub-Item A")
h := oItems:AddItem("Item B")
oItems:SetProperty("CellCaption",h,1,"Sub-Item B")
oItems:SetProperty("CellState",h,2,1)
oItems:SetProperty("CellCaption",oItems:AddItem("Item C"),1,"Sub-Item C")
oTree:FilterBarFont := oTree:Font()
oTree:SetProperty("Description",11/*exFilterBarAnd*/,Transform(oTree:FormatABC("`<fgcolor=808080> ` + value + ` </fgcolor>`",oTree:Description(11/*exFilterBarAnd*/)),""))
oTree:FilterBarCaption := "(( ( all replace `[<b>` with `<bgcolor=000000><fgcolor=FFFFFF><b> ` replace `</b>]` with ` </b></bgcolor></fgcolor>` replace `[<s>` with `<bgcolor=C0C0C0><fgcolor=FFFFFF> ` replace `</s>]` with ` </fgcolor></bgcolor>` ) + `<r><fgcolor=808080>` + ( matchitemcount < 0 ? ( ( len(value) ? `` : `` ) + `<r>` + abs(matchitemcount + 1) + ` result(s)` ) : (`<r><fgcolor=808080>`+ itemcount + ` item(s)`) )))"
oTree:FilterBarPromptVisible := 3/*exFilterBarVisible+exFilterBarPromptVisible*/
oColumn5 := oTree:Columns:Item(0)
oColumn5:FilterType := 240/*exFilter*/
oColumn5:Filter := "Item A|Item B"
oTree:Columns:Item(2):Filter := Transform(1,"")
oTree:ApplyFilter()
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
666
|
FilterBarCaption ALL Keyword ( sample 1 )

PROCEDURE OnAddItem(oTree, Item)
LOCAL i
i := oTree:FormatABC("value + 1",oTree:Items:ItemToIndex(Item))
oTree:Items():SetProperty("CellImage",Item,3,i)
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1,oColumn2,oColumn3,oColumn4,oColumn5
LOCAL oItems
LOCAL oTree
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:AddItem := {|Item| OnAddItem(oTree, Item)} /*Occurs after a new Item has been inserted to Items collection.*/
oTree:BeginUpdate()
oTree:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
oColumn := oTree:Columns():Add("Col-1")
oColumn:DisplayFilterButton := .T.
oColumn:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
oColumn1 := oTree:Columns():Add("Col-2")
oColumn1:DisplayFilterButton := .T.
oColumn1:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
oColumn2 := oTree:Columns():Add("Check")
oColumn2:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn2:DisplayFilterButton := .T.
oColumn2:DisplayFilterPattern := .F.
oColumn2:FilterType := 6/*exCheck*/
oColumn3 := oTree:Columns():Add("Image")
oColumn3:DisplayFilterButton := .T.
oColumn3:FilterType := 10/*exImage*/
oColumn3:FilterList := 9472/*exShowExclude+exShowFocusItem+exShowCheckBox*/
oColumn4 := oTree:Columns():Add("Pos")
oColumn4:AllowSizing := .F.
oColumn4:AllowSort := .F.
oColumn4:Width := 32
oColumn4:FormatColumn := "1 apos ``"
oColumn4:Position := 0
oItems := oTree:Items()
oItems:SetProperty("CellCaption",oItems:AddItem("Item A"),1,"Sub-Item A")
h := oItems:AddItem("Item B")
oItems:SetProperty("CellCaption",h,1,"Sub-Item B")
oItems:SetProperty("CellState",h,2,1)
oItems:SetProperty("CellCaption",oItems:AddItem("Item C"),1,"Sub-Item C")
oTree:FilterBarFont := oTree:Font()
oTree:SetProperty("Description",11/*exFilterBarAnd*/,Transform(oTree:FormatABC("`<fgcolor=808080> ` + value + ` </fgcolor>`",oTree:Description(11/*exFilterBarAnd*/)),""))
oTree:FilterBarCaption := "all"
oTree:FilterBarPromptVisible := 3/*exFilterBarVisible+exFilterBarPromptVisible*/
oColumn5 := oTree:Columns:Item(0)
oColumn5:FilterType := 240/*exFilter*/
oColumn5:Filter := "Item A|Item B"
oTree:Columns:Item(2):Filter := Transform(1,"")
oTree:ApplyFilter()
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
665
|
FilterBarCaption ALLUI Keyword ( sample 2, result )

PROCEDURE OnAddItem(oTree, Item)
LOCAL i
i := oTree:FormatABC("value + 1",oTree:Items:ItemToIndex(Item))
oTree:Items():SetProperty("CellImage",Item,3,i)
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1,oColumn2,oColumn3,oColumn4,oColumn5
LOCAL oItems
LOCAL oTree
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:AddItem := {|Item| OnAddItem(oTree, Item)} /*Occurs after a new Item has been inserted to Items collection.*/
oTree:BeginUpdate()
oTree:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
oColumn := oTree:Columns():Add("Col-1")
oColumn:DisplayFilterButton := .T.
oColumn:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
oColumn1 := oTree:Columns():Add("Col-2")
oColumn1:DisplayFilterButton := .T.
oColumn1:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
oColumn2 := oTree:Columns():Add("Check")
oColumn2:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn2:DisplayFilterButton := .T.
oColumn2:DisplayFilterPattern := .F.
oColumn2:FilterType := 6/*exCheck*/
oColumn3 := oTree:Columns():Add("Image")
oColumn3:DisplayFilterButton := .T.
oColumn3:FilterType := 10/*exImage*/
oColumn3:FilterList := 9472/*exShowExclude+exShowFocusItem+exShowCheckBox*/
oColumn4 := oTree:Columns():Add("Pos")
oColumn4:AllowSizing := .F.
oColumn4:AllowSort := .F.
oColumn4:Width := 32
oColumn4:FormatColumn := "1 apos ``"
oColumn4:Position := 0
oItems := oTree:Items()
oItems:SetProperty("CellCaption",oItems:AddItem("Item A"),1,"Sub-Item A")
h := oItems:AddItem("Item B")
oItems:SetProperty("CellCaption",h,1,"Sub-Item B")
oItems:SetProperty("CellState",h,2,1)
oItems:SetProperty("CellCaption",oItems:AddItem("Item C"),1,"Sub-Item C")
oTree:FilterBarFont := oTree:Font()
oTree:SetProperty("Description",11/*exFilterBarAnd*/,Transform(oTree:FormatABC("`<fgcolor=808080> ` + value + ` </fgcolor>`",oTree:Description(11/*exFilterBarAnd*/)),""))
oTree:FilterBarCaption := "(( ( allui replace `[<b>` with `<bgcolor=000000><fgcolor=FFFFFF><b> ` replace `</b>]` with ` </b></bgcolor></fgcolor>` replace `[<s>` with `<bgcolor=C0C0C0><fgcolor=FFFFFF> ` replace `</s>]` with ` </fgcolor></bgcolor>` ) + `<r><fgcolor=808080>` + ( matchitemcount < 0 ? ( ( len(value) ? `` : `` ) + `<r>` + abs(matchitemcount + 1) + ` result(s)` ) : (`<r><fgcolor=808080>`+ itemcount + ` item(s)`) )))"
oTree:FilterBarPromptVisible := 3/*exFilterBarVisible+exFilterBarPromptVisible*/
oColumn5 := oTree:Columns:Item(0)
oColumn5:FilterType := 240/*exFilter*/
oColumn5:Filter := "Item A|Item B"
oTree:Columns:Item(2):Filter := Transform(1,"")
oTree:ApplyFilter()
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
664
|
FilterBarCaption ALLUI Keyword ( sample 1 )

PROCEDURE OnAddItem(oTree, Item)
LOCAL i
i := oTree:FormatABC("value + 1",oTree:Items:ItemToIndex(Item))
oTree:Items():SetProperty("CellImage",Item,3,i)
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1,oColumn2,oColumn3,oColumn4,oColumn5
LOCAL oItems
LOCAL oTree
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:AddItem := {|Item| OnAddItem(oTree, Item)} /*Occurs after a new Item has been inserted to Items collection.*/
oTree:BeginUpdate()
oTree:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
oColumn := oTree:Columns():Add("Col-1")
oColumn:DisplayFilterButton := .T.
oColumn:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
oColumn1 := oTree:Columns():Add("Col-2")
oColumn1:DisplayFilterButton := .T.
oColumn1:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
oColumn2 := oTree:Columns():Add("Check")
oColumn2:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn2:DisplayFilterButton := .T.
oColumn2:DisplayFilterPattern := .F.
oColumn2:FilterType := 6/*exCheck*/
oColumn3 := oTree:Columns():Add("Image")
oColumn3:DisplayFilterButton := .T.
oColumn3:FilterType := 10/*exImage*/
oColumn3:FilterList := 9472/*exShowExclude+exShowFocusItem+exShowCheckBox*/
oColumn4 := oTree:Columns():Add("Pos")
oColumn4:AllowSizing := .F.
oColumn4:AllowSort := .F.
oColumn4:Width := 32
oColumn4:FormatColumn := "1 apos ``"
oColumn4:Position := 0
oItems := oTree:Items()
oItems:SetProperty("CellCaption",oItems:AddItem("Item A"),1,"Sub-Item A")
h := oItems:AddItem("Item B")
oItems:SetProperty("CellCaption",h,1,"Sub-Item B")
oItems:SetProperty("CellState",h,2,1)
oItems:SetProperty("CellCaption",oItems:AddItem("Item C"),1,"Sub-Item C")
oTree:FilterBarFont := oTree:Font()
oTree:SetProperty("Description",11/*exFilterBarAnd*/,Transform(oTree:FormatABC("`<fgcolor=808080> ` + value + ` </fgcolor>`",oTree:Description(11/*exFilterBarAnd*/)),""))
oTree:FilterBarCaption := "allui"
oTree:FilterBarPromptVisible := 3/*exFilterBarVisible+exFilterBarPromptVisible*/
oColumn5 := oTree:Columns:Item(0)
oColumn5:FilterType := 240/*exFilter*/
oColumn5:Filter := "Item A|Item B"
oTree:Columns:Item(2):Filter := Transform(1,"")
oTree:ApplyFilter()
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
663
|
FilterBarCaption AVAILABLE Keyword ( sample 2, result )

PROCEDURE OnAddItem(oTree, Item)
LOCAL i
i := oTree:FormatABC("value + 1",oTree:Items:ItemToIndex(Item))
oTree:Items():SetProperty("CellImage",Item,3,i)
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1,oColumn2,oColumn3,oColumn4,oColumn5
LOCAL oItems
LOCAL oTree
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:AddItem := {|Item| OnAddItem(oTree, Item)} /*Occurs after a new Item has been inserted to Items collection.*/
oTree:BeginUpdate()
oTree:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
oColumn := oTree:Columns():Add("Col-1")
oColumn:DisplayFilterButton := .T.
oColumn:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
oColumn1 := oTree:Columns():Add("Col-2")
oColumn1:DisplayFilterButton := .T.
oColumn1:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
oColumn2 := oTree:Columns():Add("Check")
oColumn2:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn2:DisplayFilterButton := .T.
oColumn2:DisplayFilterPattern := .F.
oColumn2:FilterType := 6/*exCheck*/
oColumn3 := oTree:Columns():Add("Image")
oColumn3:DisplayFilterButton := .T.
oColumn3:FilterType := 10/*exImage*/
oColumn3:FilterList := 9472/*exShowExclude+exShowFocusItem+exShowCheckBox*/
oColumn4 := oTree:Columns():Add("Pos")
oColumn4:AllowSizing := .F.
oColumn4:AllowSort := .F.
oColumn4:Width := 32
oColumn4:FormatColumn := "1 apos ``"
oColumn4:Position := 0
oItems := oTree:Items()
oItems:SetProperty("CellCaption",oItems:AddItem("Item A"),1,"Sub-Item A")
h := oItems:AddItem("Item B")
oItems:SetProperty("CellCaption",h,1,"Sub-Item B")
oItems:SetProperty("CellState",h,2,1)
oItems:SetProperty("CellCaption",oItems:AddItem("Item C"),1,"Sub-Item C")
oTree:FilterBarFont := oTree:Font()
oTree:SetProperty("Description",11/*exFilterBarAnd*/,Transform(oTree:FormatABC("`<fgcolor=808080> ` + value + ` </fgcolor>`",oTree:Description(11/*exFilterBarAnd*/)),""))
oTree:FilterBarCaption := "(( ( value replace `[` with `<bgcolor=000000><fgcolor=FFFFFF><b> ` replace `]` with ` </b></bgcolor></fgcolor>` ) + ` ` + ( available replace `[` with `<bgcolor=C0C0C0><fgcolor=FFFFFF><b> ` replace `]` with ` </b></bgcolor></fgcolor>` replace `<s>` with `` replace `</s>` with `` ) + `<fgcolor=808080>` + ( matchitemcount < 0 ? ( ( len(value) ? `` : `` ) + `<r>` + abs(matchitemcount + 1) + ` result(s)` ) : (`<r><fgcolor=808080>`+ itemcount + ` item(s)`) )))"
oTree:FilterBarPromptVisible := 3/*exFilterBarVisible+exFilterBarPromptVisible*/
oColumn5 := oTree:Columns:Item(0)
oColumn5:FilterType := 240/*exFilter*/
oColumn5:Filter := "Item A|Item B"
oTree:Columns:Item(2):Filter := Transform(1,"")
oTree:ApplyFilter()
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
662
|
FilterBarCaption AVAILABLE Keyword ( sample 1 )

PROCEDURE OnAddItem(oTree, Item)
LOCAL i
i := oTree:FormatABC("value + 1",oTree:Items:ItemToIndex(Item))
oTree:Items():SetProperty("CellImage",Item,3,i)
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1,oColumn2,oColumn3,oColumn4,oColumn5
LOCAL oItems
LOCAL oTree
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:AddItem := {|Item| OnAddItem(oTree, Item)} /*Occurs after a new Item has been inserted to Items collection.*/
oTree:BeginUpdate()
oTree:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
oColumn := oTree:Columns():Add("Col-1")
oColumn:DisplayFilterButton := .T.
oColumn:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
oColumn1 := oTree:Columns():Add("Col-2")
oColumn1:DisplayFilterButton := .T.
oColumn1:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
oColumn2 := oTree:Columns():Add("Check")
oColumn2:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn2:DisplayFilterButton := .T.
oColumn2:DisplayFilterPattern := .F.
oColumn2:FilterType := 6/*exCheck*/
oColumn3 := oTree:Columns():Add("Image")
oColumn3:DisplayFilterButton := .T.
oColumn3:FilterType := 10/*exImage*/
oColumn3:FilterList := 9472/*exShowExclude+exShowFocusItem+exShowCheckBox*/
oColumn4 := oTree:Columns():Add("Pos")
oColumn4:AllowSizing := .F.
oColumn4:AllowSort := .F.
oColumn4:Width := 32
oColumn4:FormatColumn := "1 apos ``"
oColumn4:Position := 0
oItems := oTree:Items()
oItems:SetProperty("CellCaption",oItems:AddItem("Item A"),1,"Sub-Item A")
h := oItems:AddItem("Item B")
oItems:SetProperty("CellCaption",h,1,"Sub-Item B")
oItems:SetProperty("CellState",h,2,1)
oItems:SetProperty("CellCaption",oItems:AddItem("Item C"),1,"Sub-Item C")
oTree:FilterBarFont := oTree:Font()
oTree:SetProperty("Description",11/*exFilterBarAnd*/,Transform(oTree:FormatABC("`<fgcolor=808080> ` + value + ` </fgcolor>`",oTree:Description(11/*exFilterBarAnd*/)),""))
oTree:FilterBarCaption := "value + ` ` + available"
oTree:FilterBarPromptVisible := 3/*exFilterBarVisible+exFilterBarPromptVisible*/
oColumn5 := oTree:Columns:Item(0)
oColumn5:FilterType := 240/*exFilter*/
oColumn5:Filter := "Item A|Item B"
oTree:Columns:Item(2):Filter := Transform(1,"")
oTree:ApplyFilter()
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
661
|
Is it possible to somehow highlight the column's name different than its filter value in the control's filter bar ( sample 3, results )

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1,oColumn2,oColumn3,oColumn4
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oColumn := oTree:Columns():Add("Col-1")
oColumn:DisplayFilterButton := .T.
oColumn:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
oColumn1 := oTree:Columns():Add("Col-2")
oColumn1:DisplayFilterButton := .T.
oColumn1:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
oColumn2 := oTree:Columns():Add("Pos")
oColumn2:AllowSizing := .F.
oColumn2:AllowSort := .F.
oColumn2:Width := 32
oColumn2:FormatColumn := "1 apos ``"
oColumn2:Position := 0
oItems := oTree:Items()
oItems:SetProperty("CellCaption",oItems:AddItem("Item A"),1,"Sub-Item A")
oItems:SetProperty("CellCaption",oItems:AddItem("Item B"),1,"Sub-Item B")
oItems:SetProperty("CellCaption",oItems:AddItem("Item C"),1,"Sub-Item C")
oTree:FilterBarFont := oTree:Font()
oTree:SetProperty("Description",11/*exFilterBarAnd*/,Transform(oTree:FormatABC("`<fgcolor=808080>` + value + `</fgcolor>`",oTree:Description(11/*exFilterBarAnd*/)),""))
oTree:FilterBarCaption := "(`<b>` + value + `</b><fgcolor=808080>` + ( matchitemcount < 0 ? ( ( len(value) ? `` : `` ) + `<r>` + abs(matchitemcount + 1) + ` result(s)` ) : (`<fgcolor=808080>`+ itemcount + ` item(s)`) )) replace `[` with `<bgcolor=000000><fgcolor=FFFFFF><b> ` replace `]` with ` </b></bgcolor></fgcolor>`"
oTree:FilterBarPromptVisible := 256/*exFilterBarToggle*/
oColumn3 := oTree:Columns:Item(0)
oColumn3:FilterType := 240/*exFilter*/
oColumn3:Filter := "Item A|Item B"
oColumn4 := oTree:Columns:Item(1)
oColumn4:FilterType := 3/*exPattern*/
oColumn4:Filter := "*B"
oTree:ApplyFilter()
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
660
|
Is it possible to somehow highlight the column's name different than its filter value in the control's filter bar ( sample 2 )

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1,oColumn2,oColumn3,oColumn4
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oColumn := oTree:Columns():Add("Col-1")
oColumn:DisplayFilterButton := .T.
oColumn:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
oColumn1 := oTree:Columns():Add("Col-2")
oColumn1:DisplayFilterButton := .T.
oColumn1:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
oColumn2 := oTree:Columns():Add("Pos")
oColumn2:AllowSizing := .F.
oColumn2:AllowSort := .F.
oColumn2:Width := 32
oColumn2:FormatColumn := "1 apos ``"
oColumn2:Position := 0
oItems := oTree:Items()
oItems:SetProperty("CellCaption",oItems:AddItem("Item A"),1,"Sub-Item A")
oItems:SetProperty("CellCaption",oItems:AddItem("Item B"),1,"Sub-Item B")
oItems:SetProperty("CellCaption",oItems:AddItem("Item C"),1,"Sub-Item C")
oTree:FilterBarFont := oTree:Font()
oTree:SetProperty("Description",11/*exFilterBarAnd*/,Transform(oTree:FormatABC("`<fgcolor=808080>` + value + `</fgcolor>`",oTree:Description(11/*exFilterBarAnd*/)),""))
oTree:FilterBarCaption := "value replace `[` with `<bgcolor=000000><fgcolor=FFFFFF><b> ` replace `]` with ` </b></bgcolor></fgcolor>`"
oTree:FilterBarPromptVisible := 256/*exFilterBarToggle*/
oColumn3 := oTree:Columns:Item(0)
oColumn3:FilterType := 240/*exFilter*/
oColumn3:Filter := "Item A|Item B"
oColumn4 := oTree:Columns:Item(1)
oColumn4:FilterType := 3/*exPattern*/
oColumn4:Filter := "*B"
oTree:ApplyFilter()
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
659
|
Is it possible to somehow highlight the column's name different than its filter value in the control's filter bar ( sample 1 )

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1,oColumn2,oColumn3,oColumn4
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oColumn := oTree:Columns():Add("Col-1")
oColumn:DisplayFilterButton := .T.
oColumn:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
oColumn1 := oTree:Columns():Add("Col-2")
oColumn1:DisplayFilterButton := .T.
oColumn1:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
oColumn2 := oTree:Columns():Add("Pos")
oColumn2:AllowSizing := .F.
oColumn2:AllowSort := .F.
oColumn2:Width := 32
oColumn2:FormatColumn := "1 apos ``"
oColumn2:Position := 0
oItems := oTree:Items()
oItems:SetProperty("CellCaption",oItems:AddItem("Item A"),1,"Sub-Item A")
oItems:SetProperty("CellCaption",oItems:AddItem("Item B"),1,"Sub-Item B")
oItems:SetProperty("CellCaption",oItems:AddItem("Item C"),1,"Sub-Item C")
oTree:SetProperty("Description",11/*exFilterBarAnd*/,Transform(oTree:FormatABC("`<fgcolor=808080>` + value + `</fgcolor>`",oTree:Description(11/*exFilterBarAnd*/)),""))
oTree:FilterBarCaption := "value replace `[` with `<fgcolor=808080>[` replace `]` with `]</fgcolor>`"
oTree:FilterBarPromptVisible := 256/*exFilterBarToggle*/
oColumn3 := oTree:Columns:Item(0)
oColumn3:FilterType := 240/*exFilter*/
oColumn3:Filter := "Item A|Item B"
oColumn4 := oTree:Columns:Item(1)
oColumn4:FilterType := 3/*exPattern*/
oColumn4:Filter := "*B"
oTree:ApplyFilter()
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
658
|
Is it possible to automatically displays the control's filter label to the right

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1,oColumn2
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oColumn := oTree:Columns():Add("Item")
oColumn:DisplayFilterButton := .T.
oColumn:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
oColumn1 := oTree:Columns():Add("Pos")
oColumn1:AllowSizing := .F.
oColumn1:AllowSort := .F.
oColumn1:Width := 32
oColumn1:FormatColumn := "1 apos ``"
oColumn1:Position := 0
oItems := oTree:Items()
oItems:AddItem("Item A")
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oTree:FilterBarCaption := "`<r>` + value"
oTree:FilterBarPromptVisible := 1280/*exFilterBarShowCloseOnRight+exFilterBarToggle*/
oColumn2 := oTree:Columns:Item(0)
oColumn2:FilterType := 240/*exFilter*/
oColumn2:Filter := "Item B"
oTree:ApplyFilter()
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
657
|
How can I get the number of results/items being shown in the control's filter bar (sample 4)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oColumn := oTree:Columns():Add("Item")
oColumn:DisplayFilterButton := .T.
oColumn:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
oColumn1 := oTree:Columns():Add("Pos")
oColumn1:AllowSizing := .F.
oColumn1:AllowSort := .F.
oColumn1:Width := 32
oColumn1:FormatColumn := "1 apos ``"
oColumn1:Position := 0
oItems := oTree:Items()
oItems:AddItem("Item A")
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oTree:FilterBarFont := oTree:Font()
oTree:FilterBarPrompt := Transform(oTree:FormatABC("`<b>` + value",oTree:FilterBarPrompt()),"")
oTree:FilterBarCaption := "`<b><r>` + value + `</b><fgcolor=808080>` + ( matchitemcount < 0 ? ( ( len(value) ? `<br>` : `` ) + `<r>` + abs(matchitemcount + 1) + ` result(s)` ) : (`<fgcolor=808080>`+ itemcount + ` item(s)`) )"
oTree:FilterBarPromptVisible := 3591/*exFilterBarCompact+exFilterBarShowCloseOnRight+exFilterBarShowCloseIfRequired+exFilterBarCaptionVisible+exFilterBarVisible+exFilterBarPromptVisible*/
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
656
|
How can I get the number of results being shown in the control's filter bar (sample 3)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:Columns():Add("Item"):DisplayFilterButton := .T.
oColumn := oTree:Columns():Add("Pos")
oColumn:AllowSizing := .F.
oColumn:AllowSort := .F.
oColumn:Width := 32
oColumn:FormatColumn := "1 apos ``"
oColumn:Position := 0
oItems := oTree:Items()
oItems:AddItem("Item A")
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oTree:FilterBarFont := oTree:Font()
oTree:FilterBarCaption := "`<b><r>` + value + `</b><fgcolor=808080>` + ( matchitemcount < 0 ? ( ( len(value) ? `<br>` : `` ) + `<r>` + abs(matchitemcount + 1) + ` result(s)` ) : ``)"
oTree:FilterBarPromptVisible := 2055/*exFilterBarCompact+exFilterBarCaptionVisible+exFilterBarVisible+exFilterBarPromptVisible*/
oColumn1 := oTree:Columns:Item(0)
oColumn1:FilterType := 240/*exFilter*/
oColumn1:Filter := "Item A|Item B"
oTree:ApplyFilter()
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
655
|
How can I get the number of results being shown in the control's filter bar (sample 2, compact)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:Columns():Add("Item"):DisplayFilterButton := .T.
oColumn := oTree:Columns():Add("Pos")
oColumn:AllowSizing := .F.
oColumn:AllowSort := .F.
oColumn:Width := 32
oColumn:FormatColumn := "1 apos ``"
oColumn:Position := 0
oItems := oTree:Items()
oItems:AddItem("Item A")
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oTree:FilterBarFont := oTree:Font()
oTree:FilterBarCaption := "`<b><r>` + value + `</b><fgcolor=808080>` + ( matchitemcount < 0 ? `<off -4> ` + abs(matchitemcount + 1) + ` result(s)` : ``)"
oTree:FilterBarPromptVisible := 2071/*exFilterBarCompact+exFilterBarSingleLine+exFilterBarCaptionVisible+exFilterBarVisible+exFilterBarPromptVisible*/
oColumn1 := oTree:Columns:Item(0)
oColumn1:FilterType := 240/*exFilter*/
oColumn1:Filter := "Item A|Item B"
oTree:ApplyFilter()
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
654
|
How can I get the number of results being shown in the control's filter bar (sample 1)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:Columns():Add("Item"):DisplayFilterButton := .T.
oColumn := oTree:Columns():Add("Pos")
oColumn:AllowSizing := .F.
oColumn:AllowSort := .F.
oColumn:Width := 32
oColumn:FormatColumn := "1 apos ``"
oColumn:Position := 0
oItems := oTree:Items()
oItems:AddItem("Item A")
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oTree:FilterBarFont := oTree:Font()
oTree:FilterBarCaption := "`<b>` + value + `</b><r><fgcolor=808080>` + ( matchitemcount < 0 ? abs(matchitemcount + 1) + ` result(s)` : ``)"
oTree:FilterBarPromptVisible := 7/*exFilterBarCaptionVisible+exFilterBarVisible+exFilterBarPromptVisible*/
oColumn1 := oTree:Columns:Item(0)
oColumn1:FilterType := 240/*exFilter*/
oColumn1:Filter := "Item A|Item B"
oTree:ApplyFilter()
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
653
|
FilterBarCaption Predefined Keywords

PROCEDURE OnAfterExpandItem(oTree, Item)
oTree:Refresh()
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1,oColumn2
LOCAL oItems
LOCAL oTree
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:AfterExpandItem := {|Item| OnAfterExpandItem(oTree, Item)} /*Fired after an item is expanded (collapsed).*/
oTree:BeginUpdate()
oTree:LinesAtRoot := -1/*exLinesAtRoot*/
oTree:Columns():Add("Item"):DisplayFilterButton := .T.
oColumn := oTree:Columns():Add("Check")
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:DisplayFilterButton := .T.
oColumn:DisplayFilterPattern := .F.
oColumn:FilterType := 6/*exCheck*/
oColumn1 := oTree:Columns():Add("Pos")
oColumn1:AllowSizing := .F.
oColumn1:AllowSort := .F.
oColumn1:Width := 32
oColumn1:FormatColumn := "1 apos ``"
oColumn1:Position := 0
oItems := oTree:Items()
oItems:AddItem("Item A")
h := oItems:AddItem("Item B")
oItems:SetProperty("CellState",oItems:InsertItem(h,,"Sub-Item B1"),1,1)
oItems:InsertItem(h,,"Sub-Item B2")
oItems:SetProperty("ExpandItem",h,.T.)
oItems:AddItem("Item C")
oTree:FilterInclude := 1/*exItemsWithChilds*/
oTree:FilterBarFont := oTree:Font()
oTree:FilterBarCaption := "`<fgcolor=0000FF><i>value/current</i></fgcolor>: <fgcolor=808080>` + value + `</fgcolor>` + `<br><fgcolor=0000FF><i>available</i></fgcolor>: ` + available + `<br><fgcolor=0000FF><i>allui</i></fgcolor>: ` + allui + `<br><fgcolor=0000FF><i>all</i></fgcolor>: ` + all + `<br><fgcolor=0000FF><i>itemcount</i></fgcolor>: <fgcolor=808080>` + itemcount + `</fgcolor>`+ `<br><fgcolor=0000FF><i>visibleitemcount</i></fgcolor>: <fgcolor=808080>` + visibleitemcount + `</fgcolor>`+ `<br><fgcolor=0000FF><i>matchitemcount</" +;
"i></fgcolor>: <fgcolor=808080>` + matchitemcount + `</fgcolor>`+ `<br><fgcolor=0000FF><i>promptpattern</i></fgcolor>: <fgcolor=808080>` + promptpattern + `</fgcolor>`+ `<br><fgcolor=0000FF><i>leafitemcount</i></fgcolor>: <fgcolor=808080>` + leafitemcount + `</fgcolor>`"
oTree:FilterBarPromptPattern := "B"
oTree:FilterBarPromptVisible := 7/*exFilterBarCaptionVisible+exFilterBarVisible+exFilterBarPromptVisible*/
oColumn2 := oTree:Columns:Item(0)
oColumn2:FilterType := 240/*exFilter*/
oColumn2:Filter := "Item A|Item B"
oTree:ApplyFilter()
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
652
|
I am using filter prompt feature, and also column's filter, just wondering if possible to compact displaying the filter bar so it won't show on multiple lines

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:Columns():Add("Item"):DisplayFilterButton := .T.
oColumn := oTree:Columns():Add("Pos")
oColumn:AllowSizing := .F.
oColumn:AllowSort := .F.
oColumn:Width := 32
oColumn:FormatColumn := "1 apos ``"
oColumn:Position := 0
oItems := oTree:Items()
oItems:AddItem("Item A")
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oTree:FilterBarFont := oTree:Font()
oTree:FilterBarCaption := "`<r><i><fgcolor=808080><upline><solidline><sha ;;0>` + value"
oTree:FilterBarPromptPattern := "B"
oTree:FilterBarPromptVisible := 2067/*exFilterBarCompact+exFilterBarSingleLine+exFilterBarVisible+exFilterBarPromptVisible*/
oColumn1 := oTree:Columns:Item(0)
oColumn1:FilterType := 240/*exFilter*/
oColumn1:Filter := "Item A|Item B"
oTree:ApplyFilter()
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
651
|
Just wondering if it is possible to show the filter bar's close button on the right ( sample 2 )

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:Columns():Add("Item"):DisplayFilterButton := .T.
oColumn := oTree:Columns():Add("Pos")
oColumn:AllowSizing := .F.
oColumn:AllowSort := .F.
oColumn:Width := 32
oColumn:FormatColumn := "1 apos ``"
oColumn:Position := 0
oItems := oTree:Items()
oItems:AddItem("Item A")
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oTree:FilterBarPromptVisible := 1281/*exFilterBarShowCloseOnRight+exFilterBarToggle+exFilterBarPromptVisible*/
oTree:FilterBarPrompt := Transform(oTree:FormatABC("`<r>` + value",oTree:FilterBarPrompt()),"")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
650
|
Just wondering if it is possible to show the filter bar's close button on the right ( sample 1 )

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:RightToLeft := .T.
oTree:Columns():Add("Item"):DisplayFilterButton := .T.
oColumn := oTree:Columns():Add("Pos")
oColumn:AllowSizing := .F.
oColumn:AllowSort := .F.
oColumn:Width := 32
oColumn:FormatColumn := "1 apos ``"
oColumn:Position := 0
oItems := oTree:Items()
oItems:AddItem("Item A")
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oTree:FilterBarPromptVisible := 257/*exFilterBarToggle+exFilterBarPromptVisible*/
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
649
|
How can I change the visual appearance of the filter bar's close button (EBN)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oAppearance
LOCAL oColumn
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oAppearance := oTree:VisualAppearance()
oAppearance:Add(1,"gBFLBCJwBAEHhEJAAEhABHQDg6AADACAxRDgMQBQKAAzAJBIYhiG4cYCgMZhXDOCYXABCEYRXBIZQ7BKNIxjSJ5BhIAAyDSJMjSRJUEhqGCWYDleYYYAKHIMQLOg7IJjyI4/SJAYCydKAWhxIaZKJHCZoEDaTAADCNVAQp6MEIJVbVEI0e79OgBLp/Z7kECIJJAaRjHQdJxGLA8EhtCQhCZteK6SgMKJYXhWQYRXI1JwvMBrWrdQjiOYELQtMKmSZNLYGG4dR5SVJbcYhSYsRRFMoyDIOXYDLKsdYqSpXIThObEGgaPqJYjsUjCMKnR7HVIURrBPC9TBPE69ZgmC6ucKPX51ShKFaBWDZcwFAS+UBuYCAILiEAQGZ1XT8OROicbgJgSTJRlCaZeDsHY7QGR4xkSYp3CaExZAQMgalQYAwjCAAfBANxcA2TgKAUOpDCGFhKg0RpXCwCwDHQHQHEyAIkCkOhbFOGA8A8DohBgRg9AccZcn8EpEjMLI2C2" +;
"DYxAgQgvAIUIVkoAAPBQDJlECTZ3CCYwDACQwUA8A5MCAWAWDiQi4l8aQOEgLJuBgBgDmYFAzEoIoIl0WALgKYJbBABADAAHgHg8VAMmqCQQDMXABAATYwTmNwBDATJXAiAgjHmNQ5lgQ5QEQEQMmcWg/GwD5ylyNw2gMcJcjsBgBgOQQDDhRpVAMMwnDBFw1B0Ax8D0DxOmmJJIGQTY5hGMAwkwM4CAYLZAmAOJnAqAojiIGg6iieYkmeAYOHaKJDCyCwjH6AoggsQpQliAJLhgaJ0CESBTnyDwjk+cg4g4P5IHIHJ+BWRRzlYWAxiOUxihsY4KjKLJRGqC44FCegkkkM58iAKAPnIWIWD8SRSFSfQnkmewUhYP4GiGKJ7G0TIbCSUoggqUo0lAQ4LnEcBcD8Coiiif4nE+eAAn2HpOkcFJqi4T5SkyMw/kqQown8IBIBOdA+A+DJrBqVxXEqYo4lCApLhGHBnD8S4ymyfxmg+cwQkQP5egOUZIWoEA" +;
"kjIeIPBMBJBD+TBjBifwvkuc58hQJQPmFrYykkchclSApKjGOBuD+TRDFCfw3mmIxNi8FxFlOXhVC4aYDFyPgvg2YBcBcLZGCGCJ0DSLRzGSWQ/lmY5+mEP5gmMDBZRSMRsFsOxMhMJJ/DsTpTnwaQaE+N5ojuNhdEYNI5C4TZJO1GRDmCaxnA2Yx4n8IpIjOTBQBQC5TgyYw7gUYRYikC0BYRwsDQBoB8eA6Q2hsE0BUXgywZtYCyHMKwnxSAhAQHkIQhRrBaDsCwA4ERiB2EWAIYIXhhiVEgAEUYwwYjyASLge4FhHgRDkM8OQih0jWPkGgBBAQ")
oTree:Columns():Add("Item"):DisplayFilterButton := .T.
oColumn := oTree:Columns():Add("Pos")
oColumn:AllowSizing := .F.
oColumn:AllowSort := .F.
oColumn:Width := 32
oColumn:FormatColumn := "1 apos ``"
oColumn:Position := 0
oItems := oTree:Items()
oItems:AddItem("Item A")
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oTree:FilterBarPromptVisible := 257/*exFilterBarToggle+exFilterBarPromptVisible*/
oTree:SetProperty("Background",1/*exFooterFilterBarButton*/,0x1000000)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
648
|
How can I change the visual appearance of the filter bar's close button (solid)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:Columns():Add("Item"):DisplayFilterButton := .T.
oColumn := oTree:Columns():Add("Pos")
oColumn:AllowSizing := .F.
oColumn:AllowSort := .F.
oColumn:Width := 32
oColumn:FormatColumn := "1 apos ``"
oColumn:Position := 0
oItems := oTree:Items()
oItems:AddItem("Item A")
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oTree:FilterBarPromptVisible := 1/*exFilterBarPromptVisible*/
oTree:SetProperty("Background",1/*exFooterFilterBarButton*/,AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. ))
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
647
|
Is it possible to prevent definitely showing the filter bar's close button

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:Columns():Add("Item"):DisplayFilterButton := .T.
oColumn := oTree:Columns():Add("Pos")
oColumn:AllowSizing := .F.
oColumn:AllowSort := .F.
oColumn:Width := 32
oColumn:FormatColumn := "1 apos ``"
oColumn:Position := 0
oItems := oTree:Items()
oItems:AddItem("Item A")
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oTree:FilterBarPromptVisible := 1/*exFilterBarPromptVisible*/
oTree:SetProperty("Background",1/*exFooterFilterBarButton*/,-1)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
646
|
Is it possible to show the close button only if there is a filter applied

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:Columns():Add("Item"):DisplayFilterButton := .T.
oColumn := oTree:Columns():Add("Pos")
oColumn:AllowSizing := .F.
oColumn:AllowSort := .F.
oColumn:Width := 32
oColumn:FormatColumn := "1 apos ``"
oColumn:Position := 0
oItems := oTree:Items()
oItems:AddItem("Item A")
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oTree:FilterBarPromptVisible := 513/*exFilterBarShowCloseIfRequired+exFilterBarPromptVisible*/
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
645
|
The control's filter bar is not closed once I click the close button (toggle)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1
LOCAL oItems
LOCAL oTree
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:Columns():Add("Item"):DisplayFilterButton := .T.
oColumn := oTree:Columns():Add("Pos")
oColumn:AllowSizing := .F.
oColumn:AllowSort := .F.
oColumn:Width := 32
oColumn:FormatColumn := "1 apos ``"
oColumn:Position := 0
oItems := oTree:Items()
oItems:AddItem("Item A")
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oItems:SetProperty("LockedItemCount",2/*BottomAlignment*/,1)
h := oItems:LockedItem(2/*BottomAlignment*/,0)
oItems:SetProperty("ItemDivider",h,0)
oItems:SetProperty("CellCaption",h,0,"<c><fgcolor=808080>Press the CTRL + F to turn on/off the control's filter bar. ALT + Up/Down moves the focus.")
oItems:SetProperty("CellCaptionFormat",h,0,1/*exHTML*/)
oTree:FilterBarCaption := "`<r><fgcolor=808080>` + value"
oTree:FilterBarPromptPattern := "B"
oTree:FilterBarPromptVisible := 2323/*exFilterBarCompact+exFilterBarToggle+exFilterBarSingleLine+exFilterBarVisible+exFilterBarPromptVisible*/
oColumn1 := oTree:Columns:Item(0)
oColumn1:FilterType := 240/*exFilter*/
oColumn1:Filter := "Item B"
oTree:ApplyFilter()
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
644
|
How can I display the control's filter on a single line

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:Columns():Add("Item"):DisplayFilterButton := .T.
oColumn := oTree:Columns():Add("Pos")
oColumn:AllowSizing := .F.
oColumn:AllowSort := .F.
oColumn:Width := 32
oColumn:FormatColumn := "1 apos ``"
oColumn:Position := 0
oItems := oTree:Items()
oItems:AddItem("Item A")
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oTree:FilterBarCaption := "len(value) ? `filter for: <fgcolor 808080>` + value : `<fgcolor 808080>no filter`"
oTree:FilterBarPromptVisible := 18/*exFilterBarSingleLine+exFilterBarVisible*/
oColumn1 := oTree:Columns:Item(0)
oColumn1:FilterType := 240/*exFilter*/
oColumn1:Filter := "Item A|Item B"
oTree:ApplyFilter()
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
643
|
How can I display the control's filter on a single line (prompt-combined)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:Columns():Add("Item"):DisplayFilterButton := .T.
oColumn := oTree:Columns():Add("Pos")
oColumn:AllowSizing := .F.
oColumn:AllowSort := .F.
oColumn:Width := 32
oColumn:FormatColumn := "1 apos ``"
oColumn:Position := 0
oItems := oTree:Items()
oItems:AddItem("Item A")
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oTree:FilterBarCaption := "`<r>` + value"
oTree:FilterBarPromptVisible := 2067/*exFilterBarCompact+exFilterBarSingleLine+exFilterBarVisible+exFilterBarPromptVisible*/
oColumn1 := oTree:Columns:Item(0)
oColumn1:FilterType := 240/*exFilter*/
oColumn1:Filter := "Item A|Item B"
oTree:ApplyFilter()
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
642
|
How can I get the number of results after a filter is applied

PROCEDURE OnClick(oTree)
oTree:ClearFilter()
RETURN
PROCEDURE OnFilterChange(oTree)
DevOut( "Items.MatchItemCount" )
DevOut( Transform(oTree:Items:MatchItemCount(),"") )
DevOut( Transform(oTree:FormatABC("value < 0 ? `filter applied: ` + abs(value + 1) + ` result(s)` : `no filter`",oTree:Items:MatchItemCount()),"") )
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:Click := {|| OnClick(oTree)} /*Occurs when the user presses and then releases the left mouse button over the tree control.*/
oTree:FilterChange := {|| OnFilterChange(oTree)} /*Notifies your application that the filter is changed.*/
oTree:BeginUpdate()
oTree:Columns():Add("Item"):DisplayFilterButton := .T.
oColumn := oTree:Columns():Add("Pos")
oColumn:AllowSizing := .F.
oColumn:AllowSort := .F.
oColumn:Width := 32
oColumn:FormatColumn := "1 apos ``"
oColumn:Position := 0
oItems := oTree:Items()
oItems:AddItem("Item A")
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oTree:FilterBarPromptVisible := 1/*exFilterBarPromptVisible*/
oTree:FilterBarPromptPattern := "Item"
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
641
|
How can I programmatically clear the control's filter

PROCEDURE OnClick(oTree)
oTree:ClearFilter()
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:Click := {|| OnClick(oTree)} /*Occurs when the user presses and then releases the left mouse button over the tree control.*/
oTree:BeginUpdate()
oTree:Columns():Add("Item"):DisplayFilterButton := .T.
oColumn := oTree:Columns():Add("Pos")
oColumn:AllowSizing := .F.
oColumn:AllowSort := .F.
oColumn:Width := 32
oColumn:FormatColumn := "1 apos ``"
oColumn:Position := 0
oItems := oTree:Items()
oItems:AddItem("Item A")
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oTree:FilterBarPromptVisible := 1/*exFilterBarPromptVisible*/
oTree:FilterBarPromptPattern := "B"
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
640
|
Is it possible to prevent closing the control's filter bar, so it is always shown (prompt-combined)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:Columns():Add("Item"):DisplayFilterButton := .T.
oColumn := oTree:Columns():Add("Pos")
oColumn:AllowSizing := .F.
oColumn:AllowSort := .F.
oColumn:Width := 32
oColumn:FormatColumn := "1 apos ``"
oColumn:Position := 0
oItems := oTree:Items()
oItems:AddItem("Item A")
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oTree:FilterBarPromptPattern := "B"
oTree:FilterBarPromptVisible := 3/*exFilterBarVisible+exFilterBarPromptVisible*/
oColumn1 := oTree:Columns:Item(0)
oColumn1:FilterType := 240/*exFilter*/
oColumn1:Filter := "Item B"
oTree:ApplyFilter()
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
639
|
Is it possible to prevent closing the control's filter bar, so it is always shown (prompt)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:Columns():Add("Item"):DisplayFilterButton := .T.
oColumn := oTree:Columns():Add("Pos")
oColumn:AllowSizing := .F.
oColumn:AllowSort := .F.
oColumn:Width := 32
oColumn:FormatColumn := "1 apos ``"
oColumn:Position := 0
oItems := oTree:Items()
oItems:AddItem("Item A")
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oTree:FilterBarPromptVisible := 1/*exFilterBarPromptVisible*/
oTree:FilterBarPromptPattern := "B"
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
638
|
Is it possible to prevent closing the control's filter bar, so it is always shown

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:Columns():Add("Item"):DisplayFilterButton := .T.
oColumn := oTree:Columns():Add("Pos")
oColumn:AllowSizing := .F.
oColumn:AllowSort := .F.
oColumn:Width := 32
oColumn:FormatColumn := "1 apos ``"
oColumn:Position := 0
oItems := oTree:Items()
oItems:AddItem("Item A")
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oTree:FilterBarCaption := "len(value) = 0 ? `<fgcolor=808080>no filter` : value"
oTree:FilterBarPromptVisible := 2/*exFilterBarVisible*/
oColumn1 := oTree:Columns:Item(0)
oColumn1:FilterType := 240/*exFilter*/
oColumn1:Filter := "Item B"
oTree:ApplyFilter()
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
637
|
How can I change the visual appearance of the +/- buttons, open/close glyphs as current visual theme (method 4)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oItems
LOCAL oTree
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:LinesAtRoot := -1/*exLinesAtRoot*/
oTree:VisualDesign := "gBFLBWIgBAEHhEJAEGg6VAkHeLpgwChAOhULB8XAUUg8MAAREEHGMcgRCJ0ei8dhABDEcQAAYAQGKIYBkAKBQAGaAoDDMOQwQwAAxjGKEEwsACEIrjKCRShyCYZRhGcTSBCIZBqEqSZLiEZRQiiCYsS5GQBRWAkEwiBiEQTjea5CgOIAFS7LIqjRQEBxhIaZYIGaiQADENo9TxIMZAfBIHShK6NJABCCSQKkYx0HScRijDIEFwGIQmbKiej4DCiCQQW7OYYRVCNMQSfa8HivJyrcamfp/YBgOBYHb1eLVPR5LwfPCGUw1P6PLxkORZHimK4tSLHV7xVpMIwZFafIQhCCoHomS5NU7UNR0TQUFx9FaGX7rDDsGwLAJ6XRgF4bg2VpnHePpenAN4bH2GwHFmApSjEGBLnWOpRGOTBZHOegrE6BxPiWVJqCweQrn0LgJAWJBjwgaw1gKO5HmWch5h+fovF+G5bmich4BgfZkB8dynRUVYqiUR5rnmex/F6" +;
"N4tn2AJfnebZ3DEXw3HWXgzAyIwgicKJKBKEIhCeCgiHyHYFEmSAFmqBghFIdgSCeIJygYDAyAgJx6AoIINAMOJNCgCZCGoGoLmMCI+CwJoihMNglCCIhzFCUg0EmMhghWDBkAiQg9CUY4jEYN4Jk2IxklYJoJHIUg+CSZJSESFwkkkGI+FOFIJEIRhPhMCRJCSVoRrSBhiDgTZjHYT4PEkYhwhgJYm0SaIaiaSYuE+GQNlmCIBGCJxjhiZQ5AkMhAg6ExJCkPhPguaAiFYUAlAkKZ0g6HoOEmWR/GHcA4m0OwIlIJIHCRgQshGJhpjoaocieaZiC6GAimkUgehIOwnGYGYIGkah6jaE4rg6SpCjKK5rEOMYlGIGIihKOggloFoqj6L5aGaBo6CkGIkAQjiPpCAAaJILCTJQlKPACDaXJgmSaJsnCdJ4nygKEoijKQpSmKcqCpKoqysK0rivLAsSyLMtC1LYty4Lkui7LwvS+L8wDBMIwzEMUxjHMgyT" +;
"KMszDNM4zzQNE0jTNQ1TWNc2DZNo2zcN03jfOA4TiOM5DlOY5zoOk6jrOw7TuO88DxPI8z0PU9j3Pg+T6Ps/D9P4/0AQFAkDQRBUGQdCEJQpC0MQ1DkPRBEUSRNFEVBhFkXRhGQ9D6Dxfh+W5gGGd4QH2XQjCmDpFFaKoVB+D5Xmed5+H8YAHnIAh9EwV5Fl0d4MkMKJICmSgygSJAoEmMUCIPgnDCCIOQFYCxJjwFoCcA4kxoF+AIJkAgExegDEgEYQInAzCUAIOEGgfxiiRDYF1Q4EQ2BSCaEQYwbAiKREMpRSymFNDIAkAxT6oVRgSA2qdVKq1WqvVirMZQUhSCnBUMoIgoQRgnGSIQUgkg1hIHYAkAYMROAmHiLsE4xxSCxBwEwCQ0wmDdBsE0GYXBtg2CSPMFIuwYiQBYBQeAcwOCnBCCZgw0g0glBONAQgqQThCGgPQGoBQfiRGmOEZIPAXjsBoPAO4HRThhA0EQSA5BAgaCKJIGg3QdhOCmNU" +;
"BoQAijTCIF0FwQxpCHDIPAYYMQGgtCmFcaQtRAjZCyFYSojQ2B2BoKwIYFApBXEIBsIQ1QsAWAWEwaA1xCgjAoIAQBAQ="
oTree:Columns():Add("Column")
oItems := oTree:Items()
h := oItems:AddItem("Root 1")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oItems:SetProperty("ExpandItem",h,.T.)
h := oItems:AddItem("Root 2")
oItems:InsertItem(h,,"Child")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
636
|
How can I change the visual appearance of the +/- buttons, open/close glyphs as current visual theme (method 3)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oAppearance
LOCAL oItems
LOCAL oTree
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oAppearance := oTree:VisualAppearance()
oAppearance:Add(3,"gBFLBCJwBAEHhEJAAEhABDwCg6AADACAxRDgMQBQKAAzAJBIYhiG4cYCgMZhXDOCYXABCEYRXBIZQ7BKNIxjSJ5BhIAAyDSJMjSRJUEhqGCWYDleYYYAKHIMQLJQKQSBcQR9EaBZBAWTpQC0OJDTJRI4TNAgbSYAAYRqoCb6loTKypaxjCQQIgkUBpGKdBynEYsDwSGyJCCJWyIbpKAwoVbcs4AYhuJpaQi+d5PFbjVT8dLAMBwLA8EwXAJ+OpfDxXU7eFKpR5fchXTI8UxXFqXZhkeQrfh7KYVRBKdBQRBEFQPJqnahqOpaXo2RoLUJKcQwHTmHYNQTALyuTALZrWeZ3XrgN74LbtZzVQauYRpbCMEr6bpoWLnFi6Ho1U4llWah1jqSweFqfxPgQQRphi+Yak0YIuqUfJegef4zluaJ3nqPJeCYH4BAeX5TDLBpVGqKRRnwf4flefZtHsX54BYAR/F+EwVnUd5eAMMJKDIChygyIQpAoEh4iIJ5Jlg" +;
"XIcgCXpIGoFwnGEQh6BEKBgmMIICHgIJCAiUAzgyUoAhwJohkiRgygwYpiGoKwzGIcgKCkNQNCMRIbCYCRYk4QoMiOchWDwNBjhiJJaDYTRiGiFwlCQAhOE8JBJHITIRgwZRZFCFCZBkOIUhKTRpCWAwgGYQ4El4NxlBifIWCcCYCFoaoMGaKYyG6GxlBmGJdhkCAWBIeA5g4U4QhMJAImkPIShRVxGgQJRlCIUISh+SJpnCZIeBgFgiHgO4OlOMINCISByECDQikkGhuh2JwpmqBogCKaYiC6FwhmkQ4yHgYgYiaHopiuaRakCbIsisSpGjYOwaHYKYMCkK5CA2IxrCwCwFigaJrkLTI6lcdANAEgIA=")
oAppearance:Add(1,"CP:3 -2 -2 2 2")
oAppearance:Add(4,"gBFLBCJwBAEHhEJAAEhABEICg6AADACAxRDgMQBQKAAzAJBIYhiG4cYCgMZhXDOCYXABCEYRXBIZQ7BKNIxjSJ5BhIAAyDSJMjSRJUEhqGCWYDleYYYAKHIMQLJQKQSBcQR9EaBZBAWTpQC0OJDTJRI4TNAgbSYAAYRqoCb6loTKypaxjCQQIgkUBpGKdBynEYsDwSGyJCCJWyIbpKAwoVbcs4AYhuJpaQi+d5PFbjVT8dLAMBwLA8EwXAJ+OpfDxXU7eFKpR5fchXTI8UxXFqXZhkeQrfh7KYVRBKdBQRBEFQPJqnahqOpaXo2RoLUJKcQwHTmHYNQTALyuTALZrWeZ3XrgN74LbtZzVQauYRpbCMEr6bpoWLnFi6Ho1U4llWah1jqSweFqfxPgQQRphi+Yak0YIuqUfJeg8X4rluaZ3niGB+AQHx/EyShjjEVYqiUR5rnmex/GAB5+AIf4gEeXJFHyXZ3gCTAygyAociMKBKEKBIeCiCZyHYFAnCE" +;
"eBkh+BghFgRIegOCgYCySAgh4CAkgINAMmMNIgCcCYjn4LoLmMCJGDKC5ijIagoDMYhCAoJg1A0IxEhsJgJFiThChCY5yFYPA0GOGIYloNhNGIaIXCUJACE4TwkEkchOFSFYlFkXhUCUCQZEYTglCSMxaEkYJIBmFJhDeDZZEYPwlgmQhghaGqVDoa4bGaeY6FGGZNlmFIBGEJ4jhiZQ5AkMhAg6E5JCkRoGCUSQ6B6CYiSCBIOh+DhJmmARiWQOJtDsCJSCSBwkXSLIRicaZ6HqIIomoIguhwIpphIHoWDsJ4mCGChpmqOpGheLIOkqUo2iya4DjGJxihiQoSj4IJaDaMpCjCWoGg6PgpBiQ4tHcQJQBAgI=")
oAppearance:Add(2,"CP:4 -2 -2 2 2")
oTree:LinesAtRoot := 1/*exGroupLinesAtRoot*/
oTree:HasButtons := 4/*exCustom*/
oTree:SetProperty("HasButtonsCustom",.F.,16777216)
oTree:SetProperty("HasButtonsCustom",.T.,33554432)
oTree:Columns():Add("Column")
oItems := oTree:Items()
h := oItems:AddItem("Root 1")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oItems:SetProperty("ExpandItem",h,.T.)
h := oItems:AddItem("Root 2")
oItems:InsertItem(h,,"Child")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
635
|
How can I change the visual appearance of the +/- buttons, open/close glyphs as current visual theme (method 2)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oAppearance
LOCAL oItems
LOCAL oTree
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oAppearance := oTree:VisualAppearance()
oAppearance:Add(1,"XP:TREEVIEW 2 1")
oAppearance:Add(2,"XP:TREEVIEW 2 2")
oTree:SetProperty("Background",180/*exTreeGlyphOpen*/,0x1000000)
oTree:SetProperty("Background",181/*exTreeGlyphClose*/,0x2000000)
oTree:LinesAtRoot := -1/*exLinesAtRoot*/
oTree:Columns():Add("Column")
oItems := oTree:Items()
h := oItems:AddItem("Root 1")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oItems:SetProperty("ExpandItem",h,.T.)
h := oItems:AddItem("Root 2")
oItems:InsertItem(h,,"Child")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
634
|
How can I find if the control is running in DPI mode
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
DevOut( Transform(oTree:FormatABC("dpi = 1 ? `normal/stretch mode` : `dpi mode`"),"") )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
633
|
How can I change the visual appearance of the +/- buttons (method 1)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oAppearance
LOCAL oItems
LOCAL oTree
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oAppearance := oTree:VisualAppearance()
oAppearance:Add(1,"gBFLBCJwBAEHhEJAAEhABDwCg6AADACAxRDgMQBQKAAzAJBIYhiG4cYCgMZhXDOCYXABCEYRXBIZQ7BKNIxjSJ5BhIAAyDSJMjSRJUEhqGCWYDleYYYAKHIMQLJQKQSBcQR9EaBZBAWTpQC0OJDTJRI4TNAgbSYAAYRqoCb6loTKypaxjCQQIgkUBpGKdBynEYsDwSGyJCCJWyIbpKAwoVbcs4AYhuJpaQi+d5PFbjVT8dLAMBwLA8EwXAJ+OpfDxXU7eFKpR5fchXTI8UxXFqXZhkeQrfh7KYVRBKdBQRBEFQPJqnahqOpaXo2RoLUJKcQwHTmHYNQTALyuTALZrWeZ3XrgN74LbtZzVQauYRpbCMEr6bpoWLnFi6Ho1U4llWah1jqSweFqfxPgQQRphi+Yak0YIuqUfJegef4zluaJ3nqPJeCYH4BAeX5TDLBpVGqKRRnwf4flefZtHsX54BYAR/F+EwVnUd5eAMMJKDIChygyIQpAoEh4iIJ5Jlg" +;
"XIcgCXpIGoFwnGEQh6BEKBgmMIICHgIJCAiUAzgyUoAhwJohkiRgygwYpiGoKwzGIcgKCkNQNCMRIbCYCRYk4QoMiOchWDwNBjhiJJaDYTRiGiFwlCQAhOE8JBJHITIRgwZRZFCFCZBkOIUhKTRpCWAwgGYQ4El4NxlBifIWCcCYCFoaoMGaKYyG6GxlBmGJdhkCAWBIeA5g4U4QhMJAImkPIShRVxGgQJRlCIUISh+SJpnCZIeBgFgiHgO4OlOMINCISByECDQikkGhuh2JwpmqBogCKaYiC6FwhmkQ4yHgYgYiaHopiuaRakCbIsisSpGjYOwaHYKYMCkK5CA2IxrCwCwFigaJrkLTI6lcdANAEgIA=")
oAppearance:Add(2,"gBFLBCJwBAEHhEJAAEhABEICg6AADACAxRDgMQBQKAAzAJBIYhiG4cYCgMZhXDOCYXABCEYRXBIZQ7BKNIxjSJ5BhIAAyDSJMjSRJUEhqGCWYDleYYYAKHIMQLJQKQSBcQR9EaBZBAWTpQC0OJDTJRI4TNAgbSYAAYRqoCb6loTKypaxjCQQIgkUBpGKdBynEYsDwSGyJCCJWyIbpKAwoVbcs4AYhuJpaQi+d5PFbjVT8dLAMBwLA8EwXAJ+OpfDxXU7eFKpR5fchXTI8UxXFqXZhkeQrfh7KYVRBKdBQRBEFQPJqnahqOpaXo2RoLUJKcQwHTmHYNQTALyuTALZrWeZ3XrgN74LbtZzVQauYRpbCMEr6bpoWLnFi6Ho1U4llWah1jqSweFqfxPgQQRphi+Yak0YIuqUfJeg8X4rluaZ3niGB+AQHx/EyShjjEVYqiUR5rnmex/GAB5+AIf4gEeXJFHyXZ3gCTAygyAociMKBKEKBIeCiCZyHYFAnCE" +;
"eBkh+BghFgRIegOCgYCySAgh4CAkgINAMmMNIgCcCYjn4LoLmMCJGDKC5ijIagoDMYhCAoJg1A0IxEhsJgJFiThChCY5yFYPA0GOGIYloNhNGIaIXCUJACE4TwkEkchOFSFYlFkXhUCUCQZEYTglCSMxaEkYJIBmFJhDeDZZEYPwlgmQhghaGqVDoa4bGaeY6FGGZNlmFIBGEJ4jhiZQ5AkMhAg6E5JCkRoGCUSQ6B6CYiSCBIOh+DhJmmARiWQOJtDsCJSCSBwkXSLIRicaZ6HqIIomoIguhwIpphIHoWDsJ4mCGChpmqOpGheLIOkqUo2iya4DjGJxihiQoSj4IJaDaMpCjCWoGg6PgpBiQ4tHcQJQBAgI=")
oTree:LinesAtRoot := -1/*exLinesAtRoot*/
oTree:SetProperty("Background",180/*exTreeGlyphOpen*/,0x1000000)
oTree:SetProperty("Background",181/*exTreeGlyphClose*/,0x2000000)
oTree:Columns():Add("Column")
oItems := oTree:Items()
h := oItems:AddItem("Root 1")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oItems:SetProperty("ExpandItem",h,.T.)
h := oItems:AddItem("Root 2")
oItems:InsertItem(h,,"Child")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
632
|
I am using single selection, the question is if possible to select an item only when the user releases the mouse, as currently it selects the item as soon as the user clicks it
PROCEDURE OnSelectionChanged(oTree)
DevOut( "SelectionChanged" )
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:SelectionChanged := {|| OnSelectionChanged(oTree)} /*Fired after a new item has been selected.*/
oTree:BeginUpdate()
oTree:FreezeEvents(.T.)
oTree:SingleSel := .T.
oTree:SelectOnRelease := .T.
oTree:Columns():Add("Column"):FormatColumn := "1 apos `A-Z`"
oItems := oTree:Items()
oItems:AddItem("")
oItems:SetProperty("SelectItem",oItems:AddItem(""),.T.)
oItems:AddItem("")
oTree:FreezeEvents(.F.)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
631
|
Is it possible to select nothing
PROCEDURE OnSelectionChanged(oTree)
DevOut( "SelectionChanged" )
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:SelectionChanged := {|| OnSelectionChanged(oTree)} /*Fired after a new item has been selected.*/
oTree:BeginUpdate()
oTree:FreezeEvents(.T.)
oTree:AllowSelectNothing := .T.
oTree:Columns():Add("Column"):FormatColumn := "1 apos `A-Z`"
oItems := oTree:Items()
oItems:AddItem("")
oItems:SetProperty("SelectItem",oItems:AddItem(""),.T.)
oItems:AddItem("")
oTree:FreezeEvents(.F.)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
630
|
How can I specify the color for control's selection when it loses the focus

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oColumn := oTree:Columns():Add("")
oColumn:AllowSizing := .F.
oColumn:AllowDragging := .F.
oColumn:AllowSort := .F.
oColumn:Width := 24
oColumn:SetProperty("Def",2/*exCellHasButton*/,.T.)
oTree:Columns():Add("Column"):FormatColumn := "1 apos `A-Z`"
oItems := oTree:Items()
oItems:AddItem("")
oItems:SetProperty("SelectItem",oItems:AddItem(""),.T.)
oItems:AddItem("")
oTree:SetProperty("Background",166/*exSelBackColorHide*/,AutomationTranslateColor( GraMakeRGBColor ( { 196,196,196 } ) , .F. ))
oTree:SetProperty("Background",167/*exSelForeColorHide*/,AutomationTranslateColor( GraMakeRGBColor ( { 0,0,1 } ) , .F. ))
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
629
|
How can I change the background color for checked items (EBN color, frame)

PROCEDURE OnCellStateChanged(oTree, Item, ColIndex)
oTree:Refresh()
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oAppearance
LOCAL oColumn
LOCAL oConditionalFormat
LOCAL oItems
LOCAL oTree
LOCAL h,hChild
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:CellStateChanged := {|Item, ColIndex| OnCellStateChanged(oTree, Item, ColIndex)} /*Fired after cell's state has been changed.*/
oTree:BeginUpdate()
oTree:LinesAtRoot := -1/*exLinesAtRoot*/
oTree:SelBackMode := 1/*exTransparent*/
oTree:DefaultItemHeight := 22
oColumn := oTree:Columns():Add("Tasks")
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:PartialCheck := .T.
oAppearance := oTree:VisualAppearance()
oAppearance:Add(2,"gBFLBCJwBAEHhEJAAEhABUkIQAAYAQGKIcBiAKBQAGYBIJDEMQ3DjAUBjMK4ZwTC4AIQjCK4JDKHYJRpHEZgLBMJAAGIZYhhUYRUiYMkiJBGGDIDiGGI2SJAcbTVIEcx9EyUJSgSTJOjCMokTTIU4TTLYASbJafJJhWSaAiyMouDIOMg1BDNIw/Hika6jOgKUisNJXRzWIBTbDlOQ3JqnbCjOQRSrQBoNDAMAiiaKlbwJPK9RoieQXfwUAJrXJcFqXFSLVxNBKAQEBA=")
oAppearance:Add(1,"CP:2 1 1 -1 -1")
oConditionalFormat := oTree:ConditionalFormats():Add("%CS0 = 1")
oConditionalFormat:SetProperty("BackColor",0x1000000)
oTree:HeaderVisible := .T.
oItems := oTree:Items()
h := oItems:AddItem("Project")
hChild := oItems:InsertItem(h,,"Task 1")
oItems:SetProperty("SelectItem",hChild,.T.)
hChild := oItems:InsertItem(h,,"Task 2")
oItems:SetProperty("CellState",hChild,0,1)
hChild := oItems:InsertItem(h,,"Task 3")
oItems:SetProperty("CellState",hChild,0,1)
oItems:SetProperty("ExpandItem",h,.T.)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
628
|
How can I change the caption of the checked items (sample 2)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oItems
LOCAL oTree
LOCAL h,hChild
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:LinesAtRoot := -1/*exLinesAtRoot*/
oColumn := oTree:Columns():Add("Tasks")
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:PartialCheck := .T.
oColumn:SetProperty("Def",17/*exCellCaptionFormat*/,1)
oColumn:FormatColumn := "%CS0 = 1 ? `<bgcolor=000000><fgcolor=FFFFFF> ` + value + ` </fgcolor></bgcolor>` : value"
oTree:HeaderVisible := .T.
oItems := oTree:Items()
h := oItems:AddItem("Project")
hChild := oItems:InsertItem(h,,"Task 1")
oItems:SetProperty("SelectItem",hChild,.T.)
hChild := oItems:InsertItem(h,,"Task 2")
oItems:SetProperty("CellState",hChild,0,1)
hChild := oItems:InsertItem(h,,"Task 3")
oItems:SetProperty("CellState",hChild,0,1)
oItems:SetProperty("ExpandItem",h,.T.)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
627
|
How can I change the caption of the checked items (sample 1)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oItems
LOCAL oTree
LOCAL h,hChild
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:LinesAtRoot := -1/*exLinesAtRoot*/
oColumn := oTree:Columns():Add("Tasks")
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:PartialCheck := .T.
oColumn:SetProperty("Def",17/*exCellCaptionFormat*/,1)
oColumn:FormatColumn := "value + (%CS0 = 1 ? `<r><fgcolor=808080>(checked)` : ``)"
oTree:HeaderVisible := .T.
oItems := oTree:Items()
h := oItems:AddItem("Project")
hChild := oItems:InsertItem(h,,"Task 1")
oItems:SetProperty("SelectItem",hChild,.T.)
hChild := oItems:InsertItem(h,,"Task 2")
oItems:SetProperty("CellState",hChild,0,1)
hChild := oItems:InsertItem(h,,"Task 3")
oItems:SetProperty("CellState",hChild,0,1)
oItems:SetProperty("ExpandItem",h,.T.)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
626
|
How can I change the font for the checked items

PROCEDURE OnCellStateChanged(oTree, Item, ColIndex)
oTree:Refresh()
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oConditionalFormat
LOCAL oItems
LOCAL oTree
LOCAL h,hChild
LOCAL f
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:CellStateChanged := {|Item, ColIndex| OnCellStateChanged(oTree, Item, ColIndex)} /*Fired after cell's state has been changed.*/
oTree:BeginUpdate()
oTree:LinesAtRoot := -1/*exLinesAtRoot*/
oTree:DefaultItemHeight := 22
oColumn := oTree:Columns():Add("Tasks")
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:PartialCheck := .T.
oConditionalFormat := oTree:ConditionalFormats():Add("%CS0 = 1")
f := CreateObject("StdFont")
f:Name := oTree:Font():Name()
f:Size := 12
oConditionalFormat:Font := f
oTree:HeaderVisible := .T.
oItems := oTree:Items()
h := oItems:AddItem("Project")
hChild := oItems:InsertItem(h,,"Task 1")
oItems:SetProperty("SelectItem",hChild,.T.)
hChild := oItems:InsertItem(h,,"Task 2")
oItems:SetProperty("CellState",hChild,0,1)
hChild := oItems:InsertItem(h,,"Task 3")
oItems:SetProperty("CellState",hChild,0,1)
oItems:SetProperty("ExpandItem",h,.T.)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
625
|
How can I bold the checked items

PROCEDURE OnCellStateChanged(oTree, Item, ColIndex)
oTree:Refresh()
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oConditionalFormat
LOCAL oItems
LOCAL oTree
LOCAL h,hChild
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:CellStateChanged := {|Item, ColIndex| OnCellStateChanged(oTree, Item, ColIndex)} /*Fired after cell's state has been changed.*/
oTree:BeginUpdate()
oTree:LinesAtRoot := -1/*exLinesAtRoot*/
oColumn := oTree:Columns():Add("Tasks")
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:PartialCheck := .T.
oConditionalFormat := oTree:ConditionalFormats():Add("%CS0 = 1")
oConditionalFormat:Bold := .T.
oTree:HeaderVisible := .T.
oItems := oTree:Items()
h := oItems:AddItem("Project")
hChild := oItems:InsertItem(h,,"Task 1")
oItems:SetProperty("SelectItem",hChild,.T.)
hChild := oItems:InsertItem(h,,"Task 2")
oItems:SetProperty("CellState",hChild,0,1)
hChild := oItems:InsertItem(h,,"Task 3")
oItems:SetProperty("CellState",hChild,0,1)
oItems:SetProperty("ExpandItem",h,.T.)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
624
|
How can I change the foreground color for checked items

PROCEDURE OnCellStateChanged(oTree, Item, ColIndex)
oTree:Refresh()
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oConditionalFormat
LOCAL oItems
LOCAL oTree
LOCAL h,hChild
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:CellStateChanged := {|Item, ColIndex| OnCellStateChanged(oTree, Item, ColIndex)} /*Fired after cell's state has been changed.*/
oTree:BeginUpdate()
oTree:LinesAtRoot := -1/*exLinesAtRoot*/
oTree:SelBackMode := 1/*exTransparent*/
oColumn := oTree:Columns():Add("Tasks")
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:PartialCheck := .T.
oConditionalFormat := oTree:ConditionalFormats():Add("%CS0 = 1")
oConditionalFormat:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,128,128 } ) , .F. ))
oTree:HeaderVisible := .T.
oItems := oTree:Items()
h := oItems:AddItem("Project")
hChild := oItems:InsertItem(h,,"Task 1")
oItems:SetProperty("SelectItem",hChild,.T.)
hChild := oItems:InsertItem(h,,"Task 2")
oItems:SetProperty("CellState",hChild,0,1)
hChild := oItems:InsertItem(h,,"Task 3")
oItems:SetProperty("CellState",hChild,0,1)
oItems:SetProperty("ExpandItem",h,.T.)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
623
|
How can I change the background color for checked items (solid color)

PROCEDURE OnCellStateChanged(oTree, Item, ColIndex)
oTree:Refresh()
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oConditionalFormat
LOCAL oItems
LOCAL oTree
LOCAL h,hChild
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:CellStateChanged := {|Item, ColIndex| OnCellStateChanged(oTree, Item, ColIndex)} /*Fired after cell's state has been changed.*/
oTree:BeginUpdate()
oTree:LinesAtRoot := -1/*exLinesAtRoot*/
oTree:SelBackMode := 1/*exTransparent*/
oColumn := oTree:Columns():Add("Tasks")
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:PartialCheck := .T.
oConditionalFormat := oTree:ConditionalFormats():Add("%CS0 = 1")
oConditionalFormat:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,128,128 } ) , .F. ))
oTree:HeaderVisible := .T.
oItems := oTree:Items()
h := oItems:AddItem("Project")
hChild := oItems:InsertItem(h,,"Task 1")
oItems:SetProperty("SelectItem",hChild,.T.)
hChild := oItems:InsertItem(h,,"Task 2")
oItems:SetProperty("CellState",hChild,0,1)
hChild := oItems:InsertItem(h,,"Task 3")
oItems:SetProperty("CellState",hChild,0,1)
oItems:SetProperty("ExpandItem",h,.T.)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
622
|
How can I export the cell's state as well

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oColumns
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oColumns := oTree:Columns()
oColumns:Add("C1"):SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumns:Add("C2"):FormatColumn := "1 index `A-Z`"
oColumns:Add("C3"):FormatColumn := "100 index ``"
oItems := oTree:Items()
oItems:AddItem("Item 1")
oItems:SetProperty("CellState",oItems:AddItem("Item 2"),1)
oItems:SetProperty("CellState",oItems:AddItem("Item 3"),1)
oTree:EndUpdate()
DevOut( "Export CSV Items including Check-State:" )
oTree:BeginUpdate()
oColumn := oTree:Columns():Add("Check")
oColumn:Position := 0
oColumn:FormatColumn := "%CS0"
DevOut( Transform(oTree:Export(""),"") )
oTree:Columns():Remove("Check")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
621
|
The BeforeExpandItem event is fired when clicking the drop down filter button. What we can do to prevent that (method 2)
PROCEDURE OnBeforeExpandItem(oTree, Item, Cancel)
DevOut( "BeforeExpandItem" )
DevOut( Transform(Item,"") )
DevOut( "ColumnFromPoint" )
DevOut( Transform(oTree:ColumnFromPoint(-1,-1),"") )
DevOut( "ColumnFromPoint return -1, if the user clicks the +/- glitch, else it returns the index of the column where the click occurs." )
oTree:Items():InsertItem(Item,,"new child")
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumns
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeforeExpandItem := {|Item, Cancel| OnBeforeExpandItem(oTree, Item, Cancel)} /*Fired before an item is about to be expanded (collapsed).*/
oTree:BeginUpdate()
oTree:LinesAtRoot := -1/*exLinesAtRoot*/
oColumns := oTree:Columns()
oColumns:Add("Items"):DisplayFilterButton := .T.
oItems := oTree:Items()
oItems:SetProperty("ItemHasChildren",oItems:InsertItem(,,"Group 1"),.T.)
oItems:SetProperty("ItemHasChildren",oItems:InsertItem(,,"Group 2"),.T.)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
620
|
The BeforeExpandItem event is fired when clicking the drop down filter button. What we can do to prevent that (method 1)
PROCEDURE OnBeforeExpandItem(oTree, Item, Cancel)
DevOut( "BeforeExpandItem" )
DevOut( Transform(Item,"") )
oTree:Items():InsertItem(Item,,"new child")
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oColumns
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeforeExpandItem := {|Item, Cancel| OnBeforeExpandItem(oTree, Item, Cancel)} /*Fired before an item is about to be expanded (collapsed).*/
oTree:BeginUpdate()
oTree:LinesAtRoot := -1/*exLinesAtRoot*/
oColumns := oTree:Columns()
oColumn := oColumns:Add("Items")
oColumn:DisplayFilterButton := .T.
oColumn:FilterList := 4/*exRootItems*/
oItems := oTree:Items()
oItems:SetProperty("ItemHasChildren",oItems:InsertItem(,,"Group 1"),.T.)
oItems:SetProperty("ItemHasChildren",oItems:InsertItem(,,"Group 2"),.T.)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
619
|
How do I change the drop down filter icon/button (black)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oAppearance
LOCAL oColumn
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oAppearance := oTree:VisualAppearance()
oAppearance:Add(1,"gBFLBCJwBAEHhEJAAEhABXUIQAAYAQGKIcBiAKBQAGYBIJDEMgzDDAUBjKKocQTC4AIQjCK4JDKHYJRpHEZyCA8EhqGASRAFUQBYiWE4oSpLABQaK0ZwIGyRIrkGQgQgmPYDSDNU4zVIEEglBI0TDNczhNDENgtGYaJqHIYpZBcM40TKkEZoSIITZcRrOEBiRL1S0RBhGcRUHZlWzdN64LhuK47UrWdD/XhdVzXRbjfz1Oq+bxve48Br7A5yYThdr4LhOFQ3RjIL4xbIcUwGe6VZhjOLZXjmO49T69HTtOCYBEBA")
oTree:SetProperty("Background",32/*exCursorHoverColumn*/,-1)
oTree:SetProperty("Background",0/*exHeaderFilterBarButton*/,0x1000000)
oTree:SetProperty("Background",26/*exBackColorFilter*/,AutomationTranslateColor( GraMakeRGBColor ( { 0,0,1 } ) , .F. ))
oTree:SetProperty("Background",27/*exForeColorFilter*/,AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. ))
oTree:SetProperty("Description",25/*exFilterBarExclude*/,"<bgcolor 0><fgcolor ffffff> Exclude </fgcolor></bgcolor>")
oTree:HeaderAppearance := 0/*None2*/
oTree:SetProperty("BackColorHeader",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. ))
oTree:SetProperty("ForeColorHeader",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. ))
oTree:HeaderVisible := .T.
oTree:SetProperty("BackColorLevelHeader",oTree:BackColor())
oColumn := oTree:Columns():Add("Filter")
oColumn:FilterList := 8448/*exShowExclude+exShowCheckBox*/
oColumn:DisplayFilterButton := .T.
oColumn:AllowSort := .F.
oColumn:AllowDragging := .F.
oItems := oTree:Items()
oItems:AddItem("One")
oItems:AddItem("Two")
oItems:AddItem("Three")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
618
|
How do I change the drop down filter icon/button (white)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oAppearance
LOCAL oColumn
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oAppearance := oTree:VisualAppearance()
oAppearance:Add(2,"gBFLBCJwBAEHhEJAAEhABX8GACAADACAxSDEMQBQKAAzQFAYbhgHCGAAGQaBUgmFgAQhFcZQSKUOQTDKNYykCIRSDUJYkSZEIyjBI8ExXFqNACkGKwYgmNYiTLAcgANJ0WBaGIZJ4gOT5fDKMoEDRRYADFCscwxJybQAqGQKKb+VgAVY/cTyBIAEQSKA0TDOQ5TSKWB4JPZQRBEbZMNBtBIUJquKaqShdQJCU5FdY3Xblez9P7AMBwLFEC4NQ8YNYuPhjR4dRTIMhvVAsUArFh8Zg9GZZFjmDIDT4ydBLTQwcyVIKnP5qOa6XbmPoCQDYKxZHYxPzVDa3axuL76dqCAT7XrXNy1TbNRrzQKfcJqfCbdw2YaDZLOOT3fjuI4hhKaRzFAHJ+jYQ4xHuY4gHuGIXGeExqC8Tp6C+PoEm+G5ImycRgh0XwvDGa5rgOeoejyXwnFeQp2mkf5ClgBB9gCWIYAwfYAEKV58mkdwOggNArgOXY2EWLoDkKOA0mg" +;
"bhOGgZApgaSBIHWSYHSmbApgYThmESZYJkIeIkgeCpfliLIHgpMIcmUYYYmODAlg2SI4mWfRfGOEguDcCRjFYAJihCQhJBSDoRmONgKEcI4kFCEJhhOVYTmYnAlEAQhWBMJYJGYWoWmWSR2F6F5lnkWAQhUAgpEieRWEuSYkjWGpmkmNhuhuZwJkYcocmaaYkjyEhngnUA6lEFAlAEgI=")
oAppearance:Add(1,"CP:2 -14 -4 -2 4")
oTree:SetProperty("Background",0/*exHeaderFilterBarButton*/,0x1000000)
oTree:SetProperty("Background",32/*exCursorHoverColumn*/,oTree:BackColor())
oTree:HeaderAppearance := 0/*None2*/
oTree:SetProperty("BackColorHeader",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. ))
oTree:HeaderVisible := .T.
oTree:HeaderHeight := 24
oTree:SetProperty("BackColorLevelHeader",oTree:BackColor())
oColumn := oTree:Columns():Add("Filter")
oColumn:DisplayFilterButton := .T.
oColumn:AllowSort := .F.
oColumn:AllowDragging := .F.
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
617
|
Do you have any Fit-To-Page options when printing the control (W x T, Fit-To )

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oPrint
LOCAL oTree
LOCAL rs
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:ColumnAutoResize := .F.
oTree:ContinueColumnScroll := .F.
rs := CreateObject("ADOR.Recordset")
rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExTree\Sample\Access\sample.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
oTree:DataSource := rs
oTree:EndUpdate()
oPrint := CreateObject("Exontrol.Print")
oPrint:Options := "FitToPage =2 x 1"
oPrint:PrintExt := oTree
oPrint:Preview()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
616
|
Do you have any Fit-To-Page options when printing the control ( x T, Fit-To Tall )

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oPrint
LOCAL oTree
LOCAL rs
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:ColumnAutoResize := .F.
oTree:ContinueColumnScroll := .F.
rs := CreateObject("ADOR.Recordset")
rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExTree\Sample\Access\sample.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
oTree:DataSource := rs
oTree:EndUpdate()
oPrint := CreateObject("Exontrol.Print")
oPrint:Options := "FitToPage = x 2"
oPrint:PrintExt := oTree
oPrint:Preview()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
615
|
Do you have any Fit-To-Page options when printing the control ( W x, Fit-To Wide )

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oPrint
LOCAL oTree
LOCAL rs
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:ColumnAutoResize := .F.
oTree:ContinueColumnScroll := .F.
rs := CreateObject("ADOR.Recordset")
rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExTree\Sample\Access\sample.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
oTree:DataSource := rs
oTree:EndUpdate()
oPrint := CreateObject("Exontrol.Print")
oPrint:Options := "FitToPage = 2 x"
oPrint:PrintExt := oTree
oPrint:Preview()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
614
|
Do you have any Fit-To-Page options when printing the control ( percent view, Adjust-To )

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oPrint
LOCAL oTree
LOCAL rs
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:ColumnAutoResize := .F.
oTree:ContinueColumnScroll := .F.
rs := CreateObject("ADOR.Recordset")
rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExTree\Sample\Access\sample.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
oTree:DataSource := rs
oTree:EndUpdate()
oPrint := CreateObject("Exontrol.Print")
oPrint:Options := "FitToPage = 50%"
oPrint:PrintExt := oTree
oPrint:Preview()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
613
|
How do I prevent changing the cell's state ( check-box state )
PROCEDURE OnCellStateChanging(oTree, Item, ColIndex, NewState)
LOCAL oItems
oItems := oTree:Items()
NewState := oItems:CellState(Item,ColIndex)
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1
LOCAL oItems
LOCAL oTree
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:CellStateChanging := {|Item, ColIndex, NewState| OnCellStateChanging(oTree, Item, ColIndex, NewState)} /*Fired before cell's state is about to be changed.*/
oTree:BeginUpdate()
oTree:LinesAtRoot := -1/*exLinesAtRoot*/
oColumn := oTree:Columns():Add("P1")
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:PartialCheck := .T.
oColumn1 := oTree:Columns():Add("P2")
oColumn1:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn1:PartialCheck := .T.
oItems := oTree:Items()
h := oItems:AddItem("Root")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oItems:SetProperty("ExpandItem",h,.T.)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
612
|
How can I use the CellState with ConditionalFormat/ComputedField/FormatColumn

PROCEDURE OnCellStateChanged(oTree, Item, ColIndex)
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1
LOCAL oItems
LOCAL oTree
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:CellStateChanged := {|Item, ColIndex| OnCellStateChanged(oTree, Item, ColIndex)} /*Fired after cell's state has been changed.*/
oTree:BeginUpdate()
oTree:LinesAtRoot := 4/*exGroupLinesInsideLeaf*/
oTree:SelBackMode := 1/*exTransparent*/
oColumn := oTree:Columns():Add("Items")
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:PartialCheck := .T.
oColumn1 := oTree:Columns():Add("Format")
oColumn1:FormatColumn := "%CS0"
oColumn1:Caption := oColumn1:FormatColumn()
oColumn1:SetProperty("Def",5/*exCellForeColor*/,8421504)
oColumn1:SetProperty("Def",8/*exHeaderForeColor*/,oColumn1:Def(5/*exCellForeColor*/))
oItems := oTree:Items()
h := oItems:AddItem("Root")
oItems:InsertItem(h,,"Item 1")
oItems:SetProperty("CellState",oItems:InsertItem(h,,"Item 2"),0,1)
oItems:SetProperty("CellState",oItems:InsertItem(h,,"Item 3"),0,1)
oItems:SetProperty("ExpandItem",h,.T.)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
611
|
How can I use the CellData with ConditionalFormat/ComputedField/FormatColumn

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:Columns():Add("Items")
oColumn := oTree:Columns():Add("Format")
oColumn:FormatColumn := "%CD0"
oColumn:Caption := oColumn:FormatColumn()
oColumn:SetProperty("Def",5/*exCellForeColor*/,8421504)
oColumn:SetProperty("Def",8/*exHeaderForeColor*/,oColumn:Def(5/*exCellForeColor*/))
oItems := oTree:Items()
oItems:SetProperty("CellData",oItems:AddItem("Item 1"),0,1234)
oItems:SetProperty("CellData",oItems:AddItem("Item 2"),0,"this is just an user data")
oItems:SetProperty("CellData",oItems:AddItem("Item 3"),0,"01/01/2001")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
610
|
How can I use the CellCaption with ConditionalFormat/ComputedField/FormatColumn

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1
LOCAL oItems
LOCAL oTree
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:Columns():Add("Items")
oColumn := oTree:Columns():Add("Format")
oColumn:FormatColumn := "%0"
oColumn:Caption := oColumn:FormatColumn()
oColumn:SetProperty("Def",5/*exCellForeColor*/,8421504)
oColumn:SetProperty("Def",8/*exHeaderForeColor*/,oColumn:Def(5/*exCellForeColor*/))
oColumn:Width := 96
oColumn:AllowSizing := .F.
oColumn1 := oTree:Columns():Add("Format")
oColumn1:FormatColumn := "%C0"
oColumn1:Caption := oColumn1:FormatColumn()
oColumn1:SetProperty("Def",5/*exCellForeColor*/,8421504)
oColumn1:SetProperty("Def",8/*exHeaderForeColor*/,oColumn1:Def(5/*exCellForeColor*/))
oColumn1:Width := 96
oColumn1:AllowSizing := .F.
oItems := oTree:Items()
oItems:AddItem(1)
h := oItems:AddItem(0)
oItems:SetProperty("CellCaption",h,0,"<b>HTML</b> Text")
oItems:SetProperty("CellCaptionFormat",h,0,1/*exHTML*/)
oItems:AddItem(2)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
609
|
Can I display the radio-button with a solid color

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:SetProperty("RadioImage",.F.,32699122)
oTree:SetProperty("RadioImage",.T.,16777216)
oTree:Columns():Add("Check"):SetProperty("Def",1/*exCellHasRadioButton*/,.T.)
oItems := oTree:Items()
oItems:AddItem("Radio 1")
oItems:SetProperty("CellState",oItems:AddItem("Radio 2"),0,1)
oItems:AddItem("Radio 1")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
608
|
Can I display the check-box with a solid color

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:SetProperty("CheckImage",0/*Unchecked*/,32699122)
oTree:SetProperty("CheckImage",1/*Checked*/,16777216)
oTree:Columns():Add("Check"):SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oItems := oTree:Items()
oItems:AddItem("Check 1")
oItems:SetProperty("CellState",oItems:AddItem("Check 2"),0,1)
oItems:AddItem("Check 3")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
607
|
Can I display the column's multiple-lines caption vertically oriented (method 2)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1,oColumn2
LOCAL oColumns
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:HeaderHeight := 48
oTree:ColumnAutoResize := .T.
oColumns := oTree:Columns()
oColumns:Add("And others ...")
oColumn := oColumns:Add("")
oColumn:HTMLCaption := "First Column"
oColumn:HeaderVertical := .T.
oColumn:Width := 36
oColumn:AllowSizing := .F.
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:SetProperty("Def",48/*exCellPaddingLeft*/,8)
oColumn:Position := 0
oColumn1 := oColumns:Add("")
oColumn1:HTMLCaption := "<c><b>Second Column"
oColumn1:HeaderVertical := .T.
oColumn1:Width := 36
oColumn1:AllowSizing := .F.
oColumn1:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn1:SetProperty("Def",48/*exCellPaddingLeft*/,8)
oColumn1:Position := 1
oColumn2 := oColumns:Add("")
oColumn2:HTMLCaption := "<r>Third Column"
oColumn2:HeaderVertical := .T.
oColumn2:Width := 36
oColumn2:AllowSizing := .F.
oColumn2:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn2:SetProperty("Def",48/*exCellPaddingLeft*/,8)
oColumn2:Position := 2
oItems := oTree:Items()
oItems:SetProperty("CellState",oItems:AddItem("Item 1"),3,1)
oItems:SetProperty("CellState",oItems:AddItem("Item 2"),2,1)
oItems:SetProperty("CellState",oItems:AddItem("Item 3"),1,1)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
606
|
Can I display the column's multiple-lines caption vertically oriented (method 1)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1,oColumn2
LOCAL oColumns
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:HeaderHeight := 48
oTree:HeaderSingleLine := .F.
oTree:ColumnAutoResize := .T.
oColumns := oTree:Columns()
oColumns:Add("And others ...")
oColumn := oColumns:Add("First Column")
oColumn:HeaderVertical := .T.
oColumn:Width := 36
oColumn:AllowSizing := .F.
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:SetProperty("Def",48/*exCellPaddingLeft*/,8)
oColumn:Position := 0
oColumn1 := oColumns:Add("Second Column")
oColumn1:HeaderBold := .T.
oColumn1:HeaderVertical := .T.
oColumn1:Width := 36
oColumn1:AllowSizing := .F.
oColumn1:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn1:SetProperty("Def",48/*exCellPaddingLeft*/,8)
oColumn1:Position := 1
oColumn2 := oColumns:Add("Third Column")
oColumn2:HeaderVertical := .T.
oColumn2:Width := 36
oColumn2:AllowSizing := .F.
oColumn2:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn2:SetProperty("Def",48/*exCellPaddingLeft*/,8)
oColumn2:Position := 2
oItems := oTree:Items()
oItems:SetProperty("CellState",oItems:AddItem("Item 1"),3,1)
oItems:SetProperty("CellState",oItems:AddItem("Item 2"),2,1)
oItems:SetProperty("CellState",oItems:AddItem("Item 3"),1,1)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
605
|
Can I display the column's caption vertically oriented (method 2)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1,oColumn2
LOCAL oColumns
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:HeaderHeight := 48
oTree:ColumnAutoResize := .T.
oColumns := oTree:Columns()
oColumns:Add("And others ...")
oColumn := oColumns:Add("")
oColumn:HTMLCaption := "First"
oColumn:HeaderVertical := .T.
oColumn:Width := 20
oColumn:AllowSizing := .F.
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:Position := 0
oColumn1 := oColumns:Add("")
oColumn1:HTMLCaption := "<c><b>Second"
oColumn1:HeaderVertical := .T.
oColumn1:Width := 20
oColumn1:AllowSizing := .F.
oColumn1:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn1:Position := 1
oColumn2 := oColumns:Add("")
oColumn2:HTMLCaption := "<r>Third"
oColumn2:HeaderVertical := .T.
oColumn2:Width := 20
oColumn2:AllowSizing := .F.
oColumn2:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn2:Position := 2
oItems := oTree:Items()
oItems:SetProperty("CellState",oItems:AddItem("Item 1"),3,1)
oItems:SetProperty("CellState",oItems:AddItem("Item 2"),2,1)
oItems:SetProperty("CellState",oItems:AddItem("Item 3"),1,1)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
604
|
Can I display the column's caption vertically oriented (method 1)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1,oColumn2
LOCAL oColumns
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:HeaderHeight := 48
oTree:ColumnAutoResize := .T.
oColumns := oTree:Columns()
oColumns:Add("And others ...")
oColumn := oColumns:Add("First")
oColumn:HeaderVertical := .T.
oColumn:Width := 20
oColumn:AllowSizing := .F.
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:Position := 0
oColumn1 := oColumns:Add("Second")
oColumn1:HeaderBold := .T.
oColumn1:HeaderVertical := .T.
oColumn1:Width := 20
oColumn1:AllowSizing := .F.
oColumn1:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn1:Position := 1
oColumn2 := oColumns:Add("Third")
oColumn2:HeaderVertical := .T.
oColumn2:Width := 20
oColumn2:AllowSizing := .F.
oColumn2:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn2:Position := 2
oItems := oTree:Items()
oItems:SetProperty("CellState",oItems:AddItem("Item 1"),3,1)
oItems:SetProperty("CellState",oItems:AddItem("Item 2"),2,1)
oItems:SetProperty("CellState",oItems:AddItem("Item 3"),1,1)
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
603
|
How do I automatically bold items being checked

PROCEDURE OnCellStateChanged(oTree, Item, ColIndex)
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oConditionalFormat
LOCAL oItems
LOCAL oTree
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:CellStateChanged := {|Item, ColIndex| OnCellStateChanged(oTree, Item, ColIndex)} /*Fired after cell's state has been changed.*/
oTree:BeginUpdate()
oTree:SelBackMode := 1/*exTransparent*/
oConditionalFormat := oTree:ConditionalFormats():Add("%CS0","check")
oConditionalFormat:Bold := .T.
oTree:Columns():Add("Items"):SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oTree:Columns():Add(oTree:ConditionalFormats:Item("check"):Expression()):FormatColumn := oTree:ConditionalFormats:Item("check"):Expression()
oItems := oTree:Items()
oItems:AddItem("Item 1")
oItems:SetProperty("CellState",oItems:AddItem("Item 2"),0,1)
oItems:AddItem("Item 3")
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
602
|
How can I include the child items, when a filter is applied

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumns
LOCAL oItems
LOCAL oTree
LOCAL h0
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oTree:ColumnAutoResize := .T.
oTree:ContinueColumnScroll := .F.
oTree:MarkSearchColumn := .F.
oTree:SearchColumnIndex := 1
oTree:Indent := 16
oTree:LinesAtRoot := -1/*exLinesAtRoot*/
oTree:FilterBarPromptVisible := -1/*0xfffff0e8+exFilterBarCompact+exFilterBarShowCloseOnRight+exFilterBarShowCloseIfRequired+exFilterBarToggle+exFilterBarSingleLine+exFilterBarCaptionVisible+exFilterBarVisible+exFilterBarPromptVisible*/
oTree:FilterBarPromptPattern := "Nancy"
oTree:FilterInclude := 1/*exItemsWithChilds*/
oColumns := oTree:Columns()
oColumns:Add("Name"):Width := 96
oColumns:Add("Title"):Width := 96
oColumns:Add("City")
oItems := oTree:Items()
h0 := oItems:AddItem("Nancy Davolio")
oItems:SetProperty("CellCaption",h0,1,"Sales Representative")
oItems:SetProperty("CellCaption",h0,2,"Seattle")
h0 := oItems:InsertItem(h0,,"Andrew Fuller")
oItems:SetProperty("CellCaption",h0,1,"Vice President, Sales")
oItems:SetProperty("CellCaption",h0,2,"Tacoma")
h0 := oItems:InsertItem(h0,,"Michael Suyama")
oItems:SetProperty("CellCaption",h0,1,"Sales Representative")
oItems:SetProperty("CellCaption",h0,2,"London")
h0 := oItems:AddItem("Janet Leverling")
oItems:SetProperty("CellCaption",h0,1,"Sales Representative")
oItems:SetProperty("CellCaption",h0,2,"Kirkland")
h0 := oItems:InsertItem(h0,,"Margaret Peacock")
oItems:SetProperty("CellCaption",h0,1,"Sales Representative")
oItems:SetProperty("CellCaption",h0,2,"Redmond")
oTree:ApplyFilter()
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
601
|
How do I get sorted the column as string, numeric, date, date and time. Also how can it be applied to drop down filter panel

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oColumn,oColumn1,oColumn2,oColumn3,oColumn4
LOCAL oItems
LOCAL oTree
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oTree := XbpActiveXControl():new( oForm:drawingArea )
oTree:CLSID := "Exontrol.Tree.1" /*{3C5FC763-72BA-4B97-9985-81862E9251F2}*/
oTree:create(,, {10,60},{610,370} )
oTree:BeginUpdate()
oColumn := oTree:Columns():Add("Date")
oColumn:SortType := 2/*SortDate*/
oColumn:DisplayFilterButton := .T.
oColumn:DisplayFilterPattern := .F.
oColumn:DisplayFilterDate := .T.
oColumn:FilterList := 1296/*exShowFocusItem+exShowCheckBox+exSortItemsDesc*/
oColumn1 := oTree:Columns():Add("DateTime")
oColumn1:SortType := 3/*SortDateTime*/
oColumn1:DisplayFilterButton := .T.
oColumn1:DisplayFilterPattern := .F.
oColumn1:FilterList := 1296/*exShowFocusItem+exShowCheckBox+exSortItemsDesc*/
oColumn2 := oTree:Columns():Add("Time")
oColumn2:SortType := 4/*SortTime*/
oColumn2:DisplayFilterButton := .T.
oColumn2:DisplayFilterPattern := .F.
oColumn2:FilterList := 1296/*exShowFocusItem+exShowCheckBox+exSortItemsDesc*/
oColumn2:FormatColumn := "time(value)"
oColumn3 := oTree:Columns():Add("Numeric")
oColumn3:SortType := 1/*SortNumeric*/
oColumn3:DisplayFilterButton := .T.
oColumn3:FilterList := 1296/*exShowFocusItem+exShowCheckBox+exSortItemsDesc*/
oColumn4 := oTree:Columns():Add("String")
oColumn4:DisplayFilterButton := .T.
oColumn4:FilterList := 1296/*exShowFocusItem+exShowCheckBox+exSortItemsDesc*/
oItems := oTree:Items()
h := oItems:AddItem("01/27/2010")
oItems:SetProperty("CellCaption",h,1,"01/27/2010 10:00:00")
oItems:SetProperty("CellCaption",h,2,oItems:CellCaption(h,1))
oItems:SetProperty("CellCaption",h,3,1)
oItems:SetProperty("CellCaption",h,4,oItems:CellCaption(h,3))
h := oItems:AddItem("01/27/2011")
oItems:SetProperty("CellCaption",h,1,"01/27/2011 09:00:00")
oItems:SetProperty("CellCaption",h,2,oItems:CellCaption(h,1))
oItems:SetProperty("CellCaption",h,3,11)
oItems:SetProperty("CellCaption",h,4,oItems:CellCaption(h,3))
h := oItems:AddItem("11/02/2010")
oItems:SetProperty("CellCaption",h,1,"11/02/2010 09:00:00")
oItems:SetProperty("CellCaption",h,2,oItems:CellCaption(h,1))
oItems:SetProperty("CellCaption",h,3,2)
oItems:SetProperty("CellCaption",h,4,oItems:CellCaption(h,3))
oTree:Columns:Item("DateTime"):DisplayFilterDate := .F.
oTree:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|